simplify colorized logging setup
This makes setup_colorized_logging be a thing which takes a single parameter and doesn't let projects do things differently. It also changes the order of values from user / project to project / user to represent the hierachy more clearly. Change-Id: I8c0ba7da54be588e3e068734feb4f78ed7c5a14a
This commit is contained in:
@@ -578,11 +578,11 @@ function vercmp {
|
||||
# setup_colorized_logging something.conf SOMESECTION
|
||||
function setup_colorized_logging {
|
||||
local conf_file=$1
|
||||
local conf_section=$2
|
||||
local project_var=${3:-"project_name"}
|
||||
local user_var=${4:-"user_name"}
|
||||
local conf_section="DEFAULT"
|
||||
local project_var="project_name"
|
||||
local user_var="user_name"
|
||||
# Add color to logging output
|
||||
iniset $conf_file $conf_section logging_context_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [[01;36m%(request_id)s [00;36m%("$user_var")s %("$project_var")s%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m"
|
||||
iniset $conf_file $conf_section logging_context_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [[01;36m%(request_id)s [00;36m%("$project_var")s %("$user_var")s%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m"
|
||||
iniset $conf_file $conf_section logging_default_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [[00;36m-%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m"
|
||||
iniset $conf_file $conf_section logging_debug_format_suffix "[00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d[00m"
|
||||
iniset $conf_file $conf_section logging_exception_prefix "%(color)s%(asctime)s.%(msecs)03d TRACE %(name)s [01;35m%(instance)s[00m"
|
||||
|
||||
Reference in New Issue
Block a user