Log Configuration File

The log framework is implemented based on glog and provides a configuration file to set basic log parameters.

Log Configuration File (logging.conf)

# MindX SDK configuration file

 
# Project name, which can be specified randomly.
program_name=mindx_sdk

# log output directory, create logs directory before use
# Log output folder. For an absolute path, logs are output in the absolute path. For a non-absolute path, logs are output in the path combined by /log/mindxsdk and log_dir in the user directory.
log_dir=logs


 
# Log file name prefix
base_filename=mxsdk.log.

# Logs are output to stderr, not to log files
# Output the log to the stderr file instead of the log file.
logtostderr=false

# time to buffer the log in seconds,0 means write to file immediately
# Set the log output period (in seconds). The value 0 indicates that logs are output immediately.
logbufsecs=0

# will output to file, where level >= global_level,default is 0
# Log level: -1-debug, 0-info, 1-warn, 2-error, 3-fatal.
# Output the log whose level is greater than or equal to the value of this parameter to a file. The default value is 0.
global_level=0

# will output to stderr, where level >= console_level,default is 2
# Log level: -1-debug, 0-info, 1-warn, 2-error, 3-fatal.
# Output logs whose level is greater than or equal to the value of this parameter to stderr. The default value is 2.
console_level=2

# max log size, unit is MB, max_log_size must be an integer, default is 100. 1 <= value <= 1024
# Maximum size of a log file, in MB. The value of max_log_size must be a positive integer greater than or equal to 1. The default value is 100.
max_log_size=100

# rotate time of log switch: 7 days(default), 1<= value <= 1000
# Log file rotate switch: The default value is 7 days.
rotate_day=7

# rotate file number of log switch: 50 (default, For each log level). 1 <= value <= 500
# Switch for rotating the number of log files. The default value is 50 (for each log level).
# The number of log files can be the same as the value of rotate_file_number only when the program exits normally. If the program exits abnormally, the actual number of log files may exceed the value of rotate_file_number.
rotate_file_number=50

# frequency of printing each log, frequency value must be an integer, defualt value is 1. 1 <= value <= 10000
# Frequency for printing each log. The value must be an integer greater ranging from 1 to 10000. The default value is 1.
flow_control_frequency=1