mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
clarify and expand console log colors help
This commit is contained in:
parent
c2df42dcf7
commit
294dfe2d94
4 changed files with 59 additions and 8 deletions
11
conf/cloud
11
conf/cloud
|
@ -54,6 +54,17 @@
|
|||
#
|
||||
# http://docs.python.org/library/logging.html#logrecord-attributes
|
||||
#
|
||||
# Console log colors are specified by these additional formatters:
|
||||
#
|
||||
# %(colorlevel)s
|
||||
# %(colorname)s
|
||||
# %(colorprocess)s
|
||||
# %(colormsg)s
|
||||
#
|
||||
# Since it is desirable to include the surrounding brackets, '[' and ']', in
|
||||
# the coloring of the messages, these color formatters also include padding as
|
||||
# well. Color LogRecord attributes are only available for console logging.
|
||||
#
|
||||
#log_fmt_console: '[%(levelname)-8s] %(message)s'
|
||||
#log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'
|
||||
|
||||
|
|
13
conf/master
13
conf/master
|
@ -652,8 +652,17 @@
|
|||
# The format of the console logging messages. Allowed formatting options can
|
||||
# be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
|
||||
#
|
||||
# Console log colors are specified by these special log formatters:
|
||||
# %(colorlevel), %(colorname), %(colorprocess), %(colormsg).
|
||||
# Console log colors are specified by these additional formatters:
|
||||
#
|
||||
# %(colorlevel)s
|
||||
# %(colorname)s
|
||||
# %(colorprocess)s
|
||||
# %(colormsg)s
|
||||
#
|
||||
# Since it is desirable to include the surrounding brackets, '[' and ']', in
|
||||
# the coloring of the messages, these color formatters also include padding as
|
||||
# well. Color LogRecord attributes are only available for console logging.
|
||||
#
|
||||
#log_fmt_console: '[%(levelname)-8s] %(message)s'
|
||||
#log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'
|
||||
|
||||
|
|
13
conf/minion
13
conf/minion
|
@ -509,8 +509,17 @@
|
|||
# The format of the console logging messages. Allowed formatting options can
|
||||
# be seen here: http://docs.python.org/library/logging.html#logrecord-attributes
|
||||
#
|
||||
# Console log colors are specified by these special log formatters:
|
||||
# %(colorlevel), %(colorname), %(colorprocess), %(colormsg).
|
||||
# Console log colors are specified by these additional formatters:
|
||||
#
|
||||
# %(colorlevel)s
|
||||
# %(colorname)s
|
||||
# %(colorprocess)s
|
||||
# %(colormsg)s
|
||||
#
|
||||
# Since it is desirable to include the surrounding brackets, '[' and ']', in
|
||||
# the coloring of the messages, these color formatters also include padding as
|
||||
# well. Color LogRecord attributes are only available for console logging.
|
||||
#
|
||||
#log_fmt_console: '[%(levelname)-8s] %(message)s'
|
||||
#log_fmt_logfile: '%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s'
|
||||
|
||||
|
|
|
@ -124,8 +124,22 @@ formatting can be seen on :func:`time.strftime <python2:time.strftime>`.
|
|||
|
||||
Default: ``[%(levelname)-8s] %(message)s``
|
||||
|
||||
The format of the console logging messages. Allowed formatting options can
|
||||
be seen on the :ref:`LogRecord attributes <python2:logrecord-attributes>`.
|
||||
The format of the console logging messages. All standard python logging
|
||||
:ref:`LogRecord attributes <python2:logrecord-attributes>` can be used. Salt
|
||||
also provides these custom LogRecord attributes to colorize console log output:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
'%(colorlevel)s' # log level name colorized by level
|
||||
'%(colorname)s' # colorized module name
|
||||
'%(colorprocess)s' # colorized process number
|
||||
'%(colormsg)s' # log message colorized by level
|
||||
|
||||
.. note::
|
||||
The ``%(colorlevel)s``, ``%(colorname)s``, and ``%(colorprocess)``
|
||||
LogRecord attributes also include padding and enclosing brackets, ``[`` and
|
||||
``]`` to match the default values of their collateral non-colorized
|
||||
LogRecord attributes.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
@ -140,8 +154,16 @@ be seen on the :ref:`LogRecord attributes <python2:logrecord-attributes>`.
|
|||
|
||||
Default: ``%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s``
|
||||
|
||||
The format of the log file logging messages. Allowed formatting options can
|
||||
be seen on the :ref:`LogRecord attributes <python2:logrecord-attributes>`.
|
||||
The format of the log file logging messages. All standard python logging
|
||||
:ref:`LogRecord attributes <python2:logrecord-attributes>` can be used. Salt
|
||||
also provides these custom LogRecord attributes that include padding and
|
||||
enclosing brackets ``[`` and ``]``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
'%(bracketlevel)s' # equivalent to [%(levelname)-8s]
|
||||
'%(bracketname)s' # equivalent to [%(name)-17s]
|
||||
'%(bracketprocess)s' # equivalent to [%(process)5s]
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue