libranet_logging

libranet_logging.__init__.

Submodules

Attributes

__copyright__

__license__

__version__

create_loglevel_trace

Functions

get_dict_config([path, logdir, variables])

Return a fully resolved logging configuration as a dictionary.

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

Initialize logging configuration with a yaml-file.

output_logging_tree([use_print])

create_loglevel([level_name, level_num])

Create a custom loglevel.

print_loggers()

Returns:

print_tree()

Returns:

Package Contents

libranet_logging.__license__: str | list[str]
libranet_logging.__version__: str | list[str]
libranet_logging.get_dict_config(path='', logdir='', variables=None)

Return a fully resolved logging configuration as a dictionary.

Parameters:

path (str)

Return type:

dict

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 (bool)

  • silent (bool)

  • use_print (bool)

  • 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
libranet_logging.print_loggers()

Returns:

Return type:

None

libranet_logging.print_tree()

Returns:

Return type:

None