Description Usage Arguments Value See Also Examples
Print Log message
1 | log_message(message, level = logger_level)
|
message |
A string |
level |
A logging level. One of 'DEBUG', 'INFO', 'WARNING', 'ERROR'. Default is 'DEBUG'. |
Prints log to console or file. This can be controlled with configure_logging
or create_logger
if log_message
is used inside logger context.
1 2 3 4 5 6 7 8 9 10 | # create a log with message 'Some text'
log_message('Some text') # default level is DEBUG
# output:
# 2016-09-21 10:55:18 - DEBUG - [Some text]
# create the same log with changed level to INFO
log_message('Some text', level = 'INFO')
# output:
# 2016-09-21 10:55:38 - INFO - [Some text]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.