mylogging.internal_module module¶
Functions for internal ‘helpers’ subpackage.
- exception mylogging.internal_module.CustomWarning[source]¶
Bases:
UserWarning
Custom warning class so it is editable.
- level: typing_extensions.Literal[DEBUG, INFO, WARNING, ERROR, CRITICAL]¶
- mylogging.internal_module.call_log_function(message, caption, level)[source]¶
As this would be called in all the log functions, here is shorthand.
- mylogging.internal_module.filter_out(message: str, level: typing_extensions.Literal[DEBUG, INFO, WARNING, ERROR, CRITICAL], once_overwrite: bool = False) bool [source]¶
Based on configuration pass or deny log based on filter and level.
- Parameters
message (str) – Used message. Necessary for ‘once’ filter.
level (Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]) – Used level.
- Returns
True if message should not be passed (has lover level or already been and filter is ‘once’).
- Return type
bool
- mylogging.internal_module.formatwarning_detailed(_message, category, _filename, _lineno, *_args, **_kwargs)[source]¶
Function that can override warnings printed info.
- mylogging.internal_module.formatwarning_stripped(message, *_args, **_kwargs)[source]¶
Function that can override warnings printed info.
- mylogging.internal_module.log_warn(message: str, level: typing_extensions.Literal[DEBUG, INFO, WARNING, ERROR, CRITICAL], showwarning_details: bool = True, stack_level: int = 3) None [source]¶
If output is configured, it will log message into defined path. If output == “console” is configured, it will log or warn.
- Parameters
message (str) – Any string content of warning.
level (str) – ‘INFO’ or something else, generated automatically from __init__ module.
showwarning_details (bool, optional) – Whether to override warnings details display. After warning, default one will be again used. Defaults to True.
stack_level (int, optional) – How many calls to log from error. Defaults to 3.