Unified Logging¶
Unified Logging (UL) utility is aimed at providing an identical logging output, configuration and interaction for different video frameworks provided by AMD AMA Video SDK. Two environmental variables LOG_AMA_CONFIG
and LOG_AMA_FILTER
control interactions with UL. LOG_AMA_CONFIG
variable controls the global setting of logging, which includes log destination, max size, log source info, and log levels. LOG_AMA_FILTER
variable filters the global configuration and narrows down the logging output to specific software layer, accelerator type or level. The following sections describe the configuration parameters of each variable.
LOG_AMA_CONFIG¶
LOG_AMA_CONFIG
is utilized as follows:
export LOG_AMA_CONFIG="[key=value | ...]"
, where key
and value
are defined as:
key |
value |
Description |
---|---|---|
destination |
|
Determines the target destination of output logs.
|
log_level |
|
Determines the log level. Defaults to |
perf_log |
|
Enables or disables performance measurements. Defaults to |
debug_file_name |
|
Enables or disables addition of log file names. Defaults to |
debug_file_line |
|
Enables or disables inclusion of log line numbers. Defaults to |
debug_time_stamp |
|
Enables or disables addition of timestamps. Defaults to |
debug_pid |
|
Enables or disables reporting of process id. Defaults to |
debug_thread |
|
Enables or disables reporting of thread id. Defaults to |
LOG_AMA_FILTER¶
LOG_AMA_FILTER
is utilized as follows:
export LOG_AMA_FILTER="[LAYER.ACCEL=log_level | ...]"
, where LAYER
and ACCEL
are defined as:
LAYER |
Description |
---|---|
SDK |
Any user space library |
VPI |
Video processing plugins |
XMA |
XMA library |
FFMPEG |
FFmpeg plugins |
GST |
Gstreamer plugins |
GEN |
General and common layers |
XRM |
XRM library |
ACCEL |
Description |
---|---|
ABR |
ABR ladder |
DEC |
Decoder |
ENC |
Encoder |
GEN |
General hardware logs |
Examples¶
Send output to
log_ama_<pid>_<timestamp>.txt
file, and setlog_level
to warning:export LOG_AMA_CONFIG="destination=file | log_level=WARN | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
Send output to
/tmp/log_ama.txt
file, and setlog_level
to info:export LOG_AMA_CONFIG="destination=file, location=/tmp/log_ama.txt | log_level=INFO | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
Send output to
/tmp/log_ama.txt
file, and setlog_level
to info, with max log file size equal to 100MB:export LOG_AMA_CONFIG="destination=file, max_size=100MB, location=/tmp/log_ama.txt | log_level=INFO | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
Get output on console, with
log_level
set to info:export LOG_AMA_CONFIG="destination=console | log_level=INFO | debug_file_line=1 | debug_time_stamp=1 | debug_pid=1 | debug_thread=1 | perf_log=0"
Assume log_level was
WARN
inLOG_AMA_CONFIG
, the following filter will additionally enableTRACE
log level ofVPI
layer forABR
plugins:export LOG_AMA_FILTER=" VPI.ABR=TRACE"
If we want all layers logs for
ABR
:export LOG_AMA_FILTER=" *.ABR=TRACE"
If we want all layers logs for
ABR
&ENC
:export LOG_AMA_FILTER=" *.ABR=TRACE | *.ENC=TRACE"
Force all logs to
ERROR
, and generate debug logs fromSDK
forABR
type:export LOG_AMA_FILTER=" *.*=ERROR | *.ABR=DEBUG"