Filter

Inheritance diagram of musify.log.filter

All logging filters specific to this package.

Functions:

format_full_func_name(record[, width])

Set fully qualified path name to function including class name to the given record.

Classes:

LogConsoleFilter([name, module_width])

Filter for logging to the console.

LogFileFilter([name, module_width])

Filter for logging to a file.

musify.log.filter.format_full_func_name(record, width=40)

Set fully qualified path name to function including class name to the given record. Optionally, provide a max width to attempt to truncate the path name to by taking only the first letter of each part of the path until the length is equal to width.

Return type:

None

class musify.log.filter.LogConsoleFilter(name='', module_width=40)

Bases: Filter

Filter for logging to the console.

Parameters:

module_width (int (default: 40)) – The maximum width a module string can be in the log record. Truncates module string if longer that this length.

Attributes:

module_width

Methods:

filter(record)

Determine if the specified record is to be logged.

module_width
filter(record)

Determine if the specified record is to be logged.

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.

Return type:

LogRecord | None

class musify.log.filter.LogFileFilter(name='', module_width=40)

Bases: Filter

Filter for logging to a file.

Parameters:

module_width (int (default: 40)) – The maximum width a module string can be in the log record. Truncates module string if longer that this length.

Attributes:

module_width

Methods:

filter(record)

Determine if the specified record is to be logged.

module_width
filter(record)

Determine if the specified record is to be logged.

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.

Return type:

LogRecord