Logger

Inheritance diagram of musify.logger

All classes and operations relating to the logger objects used throughout the entire package.

Classes:

MusifyLogger(name[, level])

The logger for all logging operations in Musify.

class musify.logger.MusifyLogger(name, level=0)

Bases: Logger

The logger for all logging operations in Musify.

Attributes:

compact

When true, never print a new line in the console when print() is called

disable_bars

When true, all bars returned by get_progress_bar() will be disabled by default

file_paths

Get a list of the paths of all file handlers for this logger

stdout_handlers

Get a list of all logging.StreamHandler handlers that log to stdout

Methods:

info_extra(msg, *args, **kwargs)

Log 'msg % args' with severity 'INFO_EXTRA'.

report(msg, *args, **kwargs)

Log 'msg % args' with severity 'REPORT'.

stat(msg, *args, **kwargs)

Log 'msg % args' with severity 'STAT'.

print_line([level])

Print a new line only when DEBUG < logger level <= level for all console handlers

print_message(*values[, sep, end])

Wrapper for print.

get_synchronous_iterator([iterable, total])

Return an appropriately configured tqdm progress bar if installed.

get_asynchronous_iterator(tasks, **kwargs)

Return an appropriately configured asynchronous tqdm progress bar if installed.

compact: bool = False

When true, never print a new line in the console when print() is called

disable_bars: bool = False

When true, all bars returned by get_progress_bar() will be disabled by default

property file_paths: list[Path]

Get a list of the paths of all file handlers for this logger

property stdout_handlers: set[StreamHandler]

Get a list of all logging.StreamHandler handlers that log to stdout

info_extra(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘INFO_EXTRA’.

Return type:

None

report(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘REPORT’.

Return type:

None

stat(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘STAT’.

Return type:

None

print_line(level=51)

Print a new line only when DEBUG < logger level <= level for all console handlers

Return type:

None

print_message(*values, sep=' ', end='\\n')

Wrapper for print. Logs the given values to the INFO setting. If there are no stdout handlers with severity <= INFO, also print this to the terminal. This ensures the user sees the values always.

Return type:

None

get_synchronous_iterator(iterable=None, total=None, **kwargs)

Return an appropriately configured tqdm progress bar if installed. If not, return either the given iterable if given or simply range(total). For tqdm kwargs, see tqdm

Return type:

GenericAlias[TypeVar(T, bound= Any)]

get_asynchronous_iterator(tasks, **kwargs)

Return an appropriately configured asynchronous tqdm progress bar if installed. If not, gather the given awaitable objects from tasks and return a coroutine.

Note that tqdm does not preserve the order of the input awaitables and will return results in a random order. For tqdm kwargs, see tqdm

Return type:

Awaitable[list[TypeVar(T)]]