Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Vasin committed Apr 11, 2023
1 parent 648a32a commit 4c7fe85
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions docs/source/entrypoint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Module support configuration from environment variables:

* `AIOMISC_LOG_LEVEL` - default logging level
* `AIOMISC_LOG_FORMAT` - default log format
* `AIOMISC_LOG_DATE_FORMAT` - default logging date format
* `AIOMISC_LOG_CONFIG` - should logging be configured
* `AIOMISC_LOG_FLUSH` - interval between logs flushing from buffer
* `AIOMISC_LOG_BUFFERING` - should logging be buffered
Expand Down Expand Up @@ -154,8 +155,8 @@ but handle ``Service``'s and other ``entrypoint``'s kwargs.
Logging configuration
=====================

``entrypoint`` accepts a specific set of formats in which logs will be
written to stderr.
``entrypoint`` accepts ``log_format`` argument with a specific set of formats,
in which logs will be written to stderr:

* ``stream`` - Python's default logging handler
* ``color`` - logging with `colorlog` module
Expand All @@ -164,13 +165,16 @@ written to stderr.
* ``plain`` - just log messages, without date or level info
* ``journald`` - available only when `logging-journald` module
has been installed.
* ``rich``/``rich_tb` - available only when `rich` module has been installed.
* ``rich``/``rich_tb`` - available only when `rich` module has been installed.
``rich_tb`` it's the same as ``rich`` but with fully expanded tracebacks.

Additionally, you can specify log level using ``log_level`` argument and date
format using ``log_date_format`` parameters.

An ``entrypoint`` will call ``aiomisc.log.basic_config`` function implicitly
using passed ``log_level=`` and ``log_format=`` parameters.
Alternatively you can call ``aiomisc.log.basic_config`` function manually
passing it already created eventloop.
using passed ``log_*`` parameters. Alternatively you can call
``aiomisc.log.basic_config`` function manually passing it already created
eventloop.

However, you can configure logging earlier using ``aiomisc_log.basic_config``,
but you will lose log buffering and flushing in a separate thread.
Expand Down

0 comments on commit 4c7fe85

Please sign in to comment.