nautical.log packageο
Submodulesο
nautical.log.log moduleο
- class nautical.log.log.NauticalLogFormatter(fmt=None, datefmt=None, style='%', validate=True)[source]ο
Bases:
Formatter
Formatter class that will be used for formatting nautical information. The formatter will add color as well as an image
- FORMATS = {10: '\x1b[34;20m[π %(levelname)s]: %(message)s\x1b[0m', 20: '\x1b[32;20m[π %(levelname)s]: %(message)s\x1b[0m', 30: '\x1b[33;20m[π %(levelname)s]: %(message)s\x1b[0m', 40: '\x1b[31;20m[π %(levelname)s]: %(message)s\x1b[0m', 50: '\x1b[35;20m[π %(levelname)s]: %(message)s\x1b[0m'}ο
- blue = '\x1b[34;20m'ο
- fmt = '[π %(levelname)s]: %(message)s'ο
- format(record)[source]ο
Format the specified record as text.
The recordβs attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- green = '\x1b[32;20m'ο
- purple = '\x1b[35;20m'ο
- red = '\x1b[31;20m'ο
- reset = '\x1b[0m'ο
- yellow = '\x1b[33;20m'ο
- nautical.log.log.get_logger(name='nautical', verbosity=10)[source]ο
Wrap the logging.getLogger functionality to apply nautical based logging information.
- Parameters
name β Name of the logger
verbosity β Level of verbosity for the logger
- Returns
logging.log formatted with the NauticalLogFormatter