dran.config package#

Submodules#

dran.config.constants module#

dran.config.logging module#

class dran.config.logging.LevelBasedFormatter[source]#

Bases: Formatter

A logging formatter that applies color-coded and level-specific formats for console output.

Each log level (DEBUG, INFO, WARNING, ERROR, CRITICAL) has its own distinct message style to improve readability in terminal output.

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.

Parameters:

record (LogRecord)

Return type:

str

dran.config.logging.disclaimer(log)[source]#
Parameters:

log (Logger)

Return type:

None

dran.config.logging.print_start(log)[source]#
Parameters:

log (Logger)

Return type:

None

dran.config.logging.load_prog(prog, log)[source]#

Print a formatted message indicating the program being loaded. Keep this free of OS-specific calls like clearing the console.

Parameters:
Return type:

None

dran.config.logging.setup_logger(debug=False, project_name='DRAN', log_file='LOGGING.txt')[source]#

Set up and configure the project logger.

Parameters:
Return type:

Logger

dran.config.logging.configure_console_logger(logger, toggle='off')[source]#

Configure a console handler for the given logger.

Parameters:
Return type:

None

dran.config.logging.configure_logging(name, log_file, toggle='off', level=10, file_mode='w')[source]#

Configure and return a project logger with file and console handlers.

Parameters:
Return type:

Logger

Module contents#