yalow API¶
-
class
yalow.
Yalow
(root_path, project_name='yalow', log_dir_name='log', level=10, file_write_mode='w')¶ Yet Another LOgging Wrapper
Wraps Python’s logging module functionality for the generic use case of generating and writing to a shared project log file in the ‘root_path/log’ directory.
- Parameters
root_path (pathlib.Path) – Root path of project.
project_name (str) – Name of project (The default is ‘yalow’, I know, very imaginative).
log_dir_name (str) – Name of the log directory created in project root (The default is ‘log’, because as we’ve already established my imagination is a veritable cornucopia of originality).
level (logging.Logger.level) – Default logging level for events added to log (The default is logging.DEBUG).
file_write_mode (str) – Mode for writing log file, ‘w’ for overwrite, ‘a’ for append (The default behavior is ‘w’ for overwrite).
-
log_filepath
¶ Path for generated log file for project.
- Type
pathlib.Path
-
logger
¶ Project shared logger object.
- Type
logging.Logger
-
handler
¶ Responsible for writing the project log to file.
- Type
logging.FileHandler
-
formatter
¶ Responsible for formatting project log file output.
- Type
logging.Formatter