Log Level

BOMnipotent Client bietet verschiedene Schweregrade an Logs:

  • error
  • warn
  • info (default)
  • debug
  • trace

Diese können wie folgt ausgewählt werden:

Eingabe (lange Variante)
bomnipotent_client --log-level=<LEVEL> <COMMAND>
Eingabe (kurze Variante)
bomnipotent_client -l <LEVEL> <COMMAND>

Sie definieren einen minimalen Schweregrad, den eine Nachricht haben muss um ausgegeben zu werden: Mit log-level debug gibt BOMnipotent alle Nachrichten der Schweregrade error, warn, info und debug aus, aber nicht trace.

Standardmäßig schreibt BOMnipotent Client die Nachrichten zu stdout, unabhängig vom Schweregrad. Sie können es stattdessen anweisen, die Logs in eine Datei zu schreiben.

Info, Warn und Error

Der Standard-Ausgabemodus ist info. Er gibt einige Informationen aus, überflutet den Benutzer jedoch nicht mit Nachrichten.

Eingabe
bomnipotent_client health
Ausgabe
[INFO] Service is healthy
Eingabe
bomnipotent_client bom list
Ausgabe
[INFO] 
╭────────────────────────┬─────────┬─────────────────────────┬───────────┬────────────╮
│ Product                │ Version │ Timestamp               │ TLP       │ Components │
├────────────────────────┼─────────┼─────────────────────────┼───────────┼────────────┤
│ Best Project           │ 3.1.4   │ 2025-01-01 10:11:12 UTC │ TLP:GREEN │ 75         │
│ Your Project           │ 1.0.0   │ 2025-01-01 10:11:12 UTC │ Default   │ 75         │
│ Your Project           │ 1.1.0   │ 2025-01-01 10:11:12 UTC │ Default   │ 75         │
│ Your Project Container │ 1.2.3   │ 2025-01-01 10:11:12 UTC │ TLP:WHITE │ 939        │
╰────────────────────────┴─────────┴─────────────────────────┴───────────┴────────────╯

Debug

Der Debug-Ausgabemodus gibt zusätzliche Informationen aus, die bei der Fehlersuche in der Eingabe oder Konfiguration nützlich sein können:

Eingabe (lange Variante)
bomnipotent_client --log-level=debug health
Eingabe (kurze Variante)
bomnipotent_client -l debug health
Ausgabe
[DEBUG] Looking for secret key
[DEBUG] The provided key is a path: /home/admin_secret_key.pem
[DEBUG] Reading secret key from provided path "/home/admin_secret_key.pem"
[DEBUG] Signing request.
[DEBUG] Assembled GET request to https://bomnipotent_server_of_your_choice/health.
[DEBUG] Call<Prepare>
[DEBUG] GET https://bomnipotent_server_of_your_choice/******
[DEBUG] Resolved: ArrayVec { len: 1, arr: [172.20.0.3:443] }
[DEBUG] Connected TcpStream to 172.20.0.3:443
[DEBUG] No cached session for DnsName("bomnipotent_server_of_your_choice")
[DEBUG] Not resuming any session
[DEBUG] Wrapped TLS
[DEBUG] Call<SendRequest>
[DEBUG] Request { method: GET, uri: https://bomnipotent_server_of_your_choice/******, version: HTTP/1.1, headers: {"accept": "*/*", "host": "bomnipotent_server_of_your_choice", "user-agent": "bomnipotent_client", "<NOTICE>": "5 HEADERS ARE REDACTED"} }
[DEBUG] Using ciphersuite TLS13_AES_256_GCM_SHA384
[DEBUG] Not resuming
[DEBUG] TLS1.3 encrypted extensions: [ServerNameAck]
[DEBUG] ALPN protocol is None
[DEBUG] add_parsable_certificates processed 143 valid and 0 invalid certs
[DEBUG] Loaded 143 CA certificates from the system
[DEBUG] Call<RecvResponse>
[DEBUG] Call<RecvBody>
[DEBUG] Response { status: 200, version: HTTP/1.1, headers: {"content-type": "text/plain; charset=utf-8", "content-length": "18", "date": "Wed, 01 Jan 2025 10:11:12 GMT", "<NOTICE>": "2 HEADERS ARE REDACTED"} }
[DEBUG] Call<Cleanup>
[DEBUG] Pool gone: PoolKey { scheme: "https", authority: bomnipotent_server_of_your_choice, proxy: None }
[INFO] Service is healthy

Trace

Im Trace-Modus gibt BOMnipotent zusätzlich das Modul aus, aus dem die Nachricht stammt. Dies ist primär nützlich, um Fehler im Programm selbst zu identifizieren.

Eingabe (lange Variante)
bomnipotent_client --log-level=trace health | grep "TRACE" | head -n 10
Eingabe (kurze Variante)
bomnipotent_client -l trace health | grep "TRACE" | head -n 10
Ausgabe
[bomnipotent_client] [TRACE] Running command Health with args Arguments {
[wwh_core_utils::http::request] [TRACE] Using platform's default root certificates.
[ureq::unversioned::resolver] [TRACE] Resolve: bomnipotent_server_of_your_choice:443
[ureq::unversioned::transport::tcp] [TRACE] Try connect TcpStream to 172.20.0.3:443
[ureq::tls::rustls] [TRACE] Try wrap in TLS
[rustls::client::hs] [TRACE] Sending ClientHello Message {
[ureq_proto::util] [TRACE] 4745 5420 2f68 6561 6c74 6820 4854 5450  GET./health.HTTP
[ureq_proto::util] [TRACE] 2f31 2e31 0d0a 6163 6365 7074 3a20 2a2f  /1.1..accept:.*/
[ureq_proto::util] [TRACE] 2a0d 0a68 6f73 743a 2062 6f6d 6e69 706f  *..host:.bomnipo
[ureq_proto::util] [TRACE] 7465 6e74 5f73 6572 7665 725f 6f66 5f79  tent_server_of_y