Logger

Defines a simple logger object to write log data to a file based on log levels.

LogLevel: LogLevel
default_verbosity: LogLevel

 

__init__(self, log_file=None, log_level=None, print_function=None, padding='', newline='\n'): 

 

to_state(self, serializer=None): 

 

from_state(state, serializer=None): 

 

block(self, **kwargs): 

 

register(self, key): 

Registers the logger under the given key

  • key: Any
  • :returns: _

 

lookup(key): 

Looks up a logger. Has the convenient, but potentially surprising behavior that if no logger is found a NullLogger is returned.

  • key: Any
  • :returns: _

 

preformat_keys(key_functions): 

Generates a closure that will take the supplied keys/function pairs and update them appropriately

  • key_functions: Any
  • :returns: _

 

format_message(self, message, *params, preformatter=None, **kwargs): 

 

format_metainfo(self, metainfo): 

 

split_lines(obj): 

 

prep_array(obj): 

 

prep_dict(obj): 

 

log_print(self, message, *messrest, message_prepper=None, padding=None, newline=None, log_level=None, metainfo=None, print_function=None, print_options=None, sep=None, end=None, file=None, flush=None, preformatter=None, **kwargs): 
  • message: str | Iterable[str]

    message to print

  • params: Any
  • print_options: Any

    options to be passed through to print

  • kwargs: Any
  • :returns: _

 

__repr__(self): 

Feedback

Examples

Templates

Documentation