km3flux.logger
¶
Module Contents¶
Functions¶
Checks if the terminal supports color. |
|
|
Colorize text, while stripping nested ANSI color sequences. |
|
Return the ANSI hash colour prefix and suffix for a given text |
Check if running within a Jupyter notebook |
|
|
Helper function to get a logger |
|
Set the log level for given logger |
Attributes¶
- km3flux.logger.colored(text, color=None, on_color=None, attrs=None, ansi_code=None)[source]¶
Colorize text, while stripping nested ANSI color sequences.
Author: Konstantin Lepa <konstantin.lepa@gmail.com> / termcolor
- Available text colors:
red, green, yellow, blue, magenta, cyan, white.
- Available text highlights:
on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
- Available attributes:
bold, dark, underline, blink, reverse, concealed.
- Example:
colored(‘Hello, World!’, ‘red’, ‘on_grey’, [‘blue’, ‘blink’]) colored(‘Hello, World!’, ‘green’)
- km3flux.logger.hash_coloured_escapes(text)[source]¶
Return the ANSI hash colour prefix and suffix for a given text