-
Notifications
You must be signed in to change notification settings - Fork 43
Per-module logging #3590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-module logging #3590
Conversation
b49fd42
to
0384785
Compare
0384785
to
6fb2673
Compare
d49d02b
to
dda9ec9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following points from #3264 are missed:
It is possible to set custom log levels for files (modules) that just use default logger without creating a new instance by log.new()
The name of a module is determined automatically during the execution of require('log') in the module's source code. The name is derived from its filename, including a part of the path.
There is a special module name "tarantool", which allows to set log level for Tarantool core messages. To be more precise, it sets log level for all messages logged from the non-Lua code, including user C modules.
f7c7f04
to
d77b32b
Compare
Thanks! Updated the docs as follows to reflect missed points:
|
doc/reference/reference_lua/log.rst
Outdated
|
||
Note that calling ``log.cfg()`` before ``box.cfg()`` takes into account | ||
logging options specified using :ref:`environment variables <box-cfg-params-env>`, | ||
such as ``TT_LOG``, ``TT_LOG_LEVEL``, and so on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
such as ``TT_LOG``, ``TT_LOG_LEVEL``, and so on. | |
such as ``TT_LOG`` and ``TT_LOG_LEVEL``. |
doc/reference/reference_lua/log.rst
Outdated
:lines: 9-13 | ||
:dedent: | ||
|
||
To create the ``module1`` and ``module1`` modules, call the ``new()`` function: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To create the ``module1`` and ``module1`` modules, call the ``new()`` function: | |
To create the ``module1`` and ``module2`` loggers, call the ``new()`` function: |
d77b32b
to
4e3d482
Compare
4e3d482
to
1ce1f6e
Compare
log
module API reference.box.cfg()
.Note that doc code snippets are included from testable examples placed in the doc/code_snippets folder for making sure they are correct and runnable.