Top level package for dailylog.
Top level module cache for dailylog.
- class CacheRecord(d_obj=None)[source]¶
Bases:
objectClass representing a cache record.
- class Cache(ctx)[source]¶
Bases:
ConfigClass to manage the cache.
- log_message(key, message, **kwargs)[source]¶
Log message.
- Return type:
bool
Parameters¶
- keystr
unique key for message
- messagestr
the message to log
- **kwargsdict, optional
- label: str
Should be one of CRITICAL, ERROR, WARNING, INFO, DEBUG
- suppress: int
Integer representing number of seconds to suppress screen output
- logfn: str
this is a string representing a log file other than the default
Returns¶
- bool
True if record was was displayed
- static append_daily(label, message, log_fn, s_cnt=None)[source]¶
Append a message to the specified log file.
- Return type:
None
Parameters¶
- labelstr
Log level label DEBUG, INFO, WARNING, ERROR …
- messagestr
Record to log
- log_fnstr
Path name of log file
- s_cntint
Number of seconds to suppress screen output.
Top-level module cli for dailylog.
- log_label(level)[source]¶
Return logger level name.
- Return type:
str
Parameters¶
- levelstr
Level number or name
Returns¶
- str
Level name, Default if not matched, by default “ERROR”
Top level module config for dailylog.
- class Config(ctx)[source]¶
Bases:
OptionsClass to manage the configuration.
- set_default_log(log_fn)[source]¶
Set the default log file.
Parameters¶
- log_fnstr
Absolute path to the log file
- static update_config(config)[source]¶
Update configuration from version to current version.
- Parameters:
config (StrAnyDict) – previous config verstion
- Return type:
Dict[str,Any]
- static validate_path(path)[source]¶
Validate the file path exists or can be created.
- Parameters:
path (Path) – files spec for log
- Raises:
FileNotFoundError – when parent directory doesn’t exist or is not a directory
FilePermError – when parent directory is not writable
- Return type:
None
- default_log()[source]¶
Returns the path to the default log.
- Return type:
str
Returns¶
- str
Path to the default log
- static validate_existing_path(path)[source]¶
Validate existing path.
- Parameters:
path (Path) – files spec for log
- Raises:
FileNotFoundError – when path exists but is not a file
FilePermError – when path exists but is not writable
- Return type:
None
Top level module exceptions for dailylog.
Top level module options for dailylog.
- class Options(ctx)[source]¶
Bases:
objectClass to manage the options.
- static validate_fn_absolute(file_key, file_name)[source]¶
Validate an absolute file name/path.
- Parameters:
file_key (str) – key name of file “config | cache”
file_name (str) – path name of file to validate
- Raises:
ValueError – when file_name is empty string
ValueError – when file_name is not absolute
- Returns:
validate file name/path as a string
- Return type:
str