rotifer.core.log.log#
- rotifer.core.log.log(message={}, level=0, log_file='', name='')[source]#
Output a message to stderr.
Three options available: 1-) Input a string 2-) Input a list with one element 3-) Input a list with n elements
If a list with more than one element is passed, the first element will be printed with timelog the other lines will be printed in a new line. ———– PARAMETERS: message: A dictionary containing the messages. level: Verbose level (0-3) (default: 0) log_file: A file to save the log (default: ‘’) name: Script name (default: __name__) ———– OUTPUT: A message in the format for option (1) and (2) ## [DAY/MONTH Hour:Minute:Second] <message> or
A message in the format for option (3) ## [DAY/MONTH Hour:Minute:Second] <message> ### <message> ### … ———– Example: from rotifer.core.log import log
- if verbose:
- log({1: ‘Info message’,
2: ‘Warning message’, 3: ‘Debug message’}, level = verbose, log_file = log_file, )
- if verbose:
- log({1: ‘Info message’,
2: ‘Warning message’, 3: ‘Debug message’}, level = verbose, log_file = log_file, name = __name__ # only needed if used inside a package )