From 16b28ec493a1315653e796379cfea4d87db95323 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Thu, 7 Apr 2016 19:13:01 -0500 Subject: [PATCH] Document "logformat" option for i3pystatus.status.Status() --- docs/configuration.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index 4dd04ac..4ff694e 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -248,6 +248,26 @@ files containing errors. status = Status(logfile='/home/username/var/i3pystatus.log') +Changing log format +~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 3.35 + +The ``logformat`` option can be useed to change the format of the log files, +using `LogRecord attributes`__. + +.. code-block:: python + + from i3pystatus import Status + + status = Status( + logfile='/home/username/var/i3pystatus.log', + logformat='%(asctime)s %(levelname)s:', + ) + +.. __: https://docs.python.org/3/library/logging.html#logrecord-attributes + + Log level ~~~~~~~~~