libranet_logging

libranet_logging.__init__

Submodules

Package Contents

Functions

print_loggers()

Returns:

print_tree()

Returns:

initialize([path, logdir, capture_warnings, silent, ...])

Initialize logging configuration with a yaml-file.

output_logging_tree([use_print])

param use_print:

create_loglevel([level_name, level_num])

Create a custom loglevel.

Attributes

__version__

create_loglevel_trace

libranet_logging.__version__ = '1.4.dev0'
libranet_logging.print_loggers()

Returns:

Return type:

None

libranet_logging.print_tree()

Returns:

Return type:

None

libranet_logging.initialize(path='', logdir='', capture_warnings=True, silent=False, use_print=False, variables=None)

Initialize logging configuration with a yaml-file.

Parameters:
  • path

  • logdir

  • capture_warnings

  • silent

  • use_print

  • variables

Returns:

libranet_logging.output_logging_tree(use_print=False)
Parameters:

use_print

Returns:

libranet_logging.create_loglevel(level_name='', level_num=0)

Create a custom loglevel.

Defining your own levels is possible, but should not be necessary, as the existing levels have been chosen on the basis of practical experience. However, if you are convinced that you need custom levels, great care should be exercised when doing this, and it is possibly a very bad idea to define custom levels if you are developing a library. That’s because if multiple library authors all define their own custom levels, there is a chance that the logging output from such multiple libraries used together will be difficult for the using developer to control and/or interpret, because a given numeric value might mean different things for different libraries. Cfr. https://docs.python.org/3/howto/logging.html#custom-levels

Default levels:

0 NOTSET 10 DEBUG 20 INFO 30 WARNING 40 ERROR 50 CRITICAL

Parameters:
  • level_name – logger-name

  • level_num – numeric level of the custom logger, positive integer

Returns:

None

Side-effect:

adds attribute to Logger-class

libranet_logging.create_loglevel_trace