Nmcli / Set Logging Level Domains
Set Logging Level Domains
Nmcli command syntax to set logging level domains. Copyable examples, output expectations, and common mistakes.
$
Terminal sudo nmcli g l l <INFO|OFF|ERR|WARN|DEBUG|TRACE> domain <domain_1,domain_2,...> sudo nmcli g l l <INFO|OFF|ERR|WARN|DEBUG|TRACE> domain <domain_1,domain_2,...> #!/bin/bash
# Set Logging Level Domains
sudo nmcli {{[g|general]}} {{[l|logging]}} {{[l|level]}} {{INFO|OFF|ERR|WARN|DEBUG|TRACE}} domain {{domain_1,domain_2,...}} import subprocess
# Set Logging Level Domains
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"nmcli",
"nmcli",
"g",
"l",
"l",
"<INFO|OFF|ERR|WARN|DEBUG|TRACE>",
"domain",
"<domain_1,domain_2,...>"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: nmcli not found. Please install it first.")
if __name__ == "__main__":
run_command() Command Breakdown
What each part is doing
-
sudo - Base Command
- The executable that performs this operation. Here it runs Nmcli before the shell applies any redirect operators.
-
g - g|general
- The value supplied for g|general.
-
l - l|logging
- The value supplied for l|logging.
-
l - l|level
- The value supplied for l|level.
-
<INFO|OFF|ERR|WARN|DEBUG|TRACE> - INFO|OFF|ERR|WARN|DEBUG|TRACE
- The value supplied for INFO|OFF|ERR|WARN|DEBUG|TRACE.
-
<domain_1,domain_2,...> - domain 1,domain 2,...
- The value supplied for domain 1,domain 2,....
Alternative Approaches
Comparable commands in other tools
Alternative observability tools for the same job.
Trace Cmd / Display Recorded Trace Specific Cpu Linux
sudo trace-cmd report --cpu <cpu_number> Trace Cmd / Start Tracing With Plugin Linux sudo trace-cmd start -p <function|function_graph|preemptirqsoff|irqsoff|preemptoff|wakeup|...> Trace Cmd / Stop Tracing Retain Buffers Linux sudo trace-cmd stop Trace Cmd / Record Trace With Plugin Linux sudo trace-cmd record -p <plugin> Trace Cmd / Clear Trace Buffers Linux sudo trace-cmd clear