custom_logging

This file contains a custom logger with different print levels and specific formatting. It also contains a progress bar function that can be used to show progress of a loop. The decorator_provide_time_information can be used to wrap a function and provide time

together with a starting and finished message, that works congruently with the logger.

Example usage:

logger = CustomLogger(“test_logger”, “logs”) logger.info(“This is an info message”, print_level=3) logger.starting(“This is a starting message”, print_level=3) logger.finished(“This is a finished message”, print_level=3)

Created by Jelle Bonthuis on 2025-03-24

Classes

CustomFormatter([fmt, datefmt, style, ...])

CustomLogger(name[, log_files_location, ...])

PrintLevelFilter(print_level)

Functions

decorator_provide_time_information(function)

Decorator that provides time information for a function This requires the function to be called from a class instance and the class instance to have a logger attribute # todo make this more general to not require specific class instances

decorator_provide_time_information_2([...])

memory_checker(func, *args, **kwargs)

parse_log_file(log_path)

Generated: validation needed.

profile_memory_full(func)

Generated: validation needed.

profile_time(func)

Generated: validation needed.

progressBar(iterable[, prefix, suffix, ...])

Taken from https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console

time_checker(func, *args, **kwargs)