Utilities to create and set the logger.
Manim’s logger can be accessed as manim.logger
, or as
logging.getLogger("manim")
, once the library has been imported. Manim also
exports a second object, console
, which should be used to print on screen
messages that need not be logged.
Both logger
and console
use the rich
library to produce rich text
format.
Classes
A formatter that outputs logs in a custom JSON format. |
Functions
make_logger
(parser, verbosity)[source]¶Make the manim logger and console.
parser (configparser.ConfigParser
) – A parser containing any .cfg files in use.
verbosity (str
) – The verbosity level of the logger.
The manim logger and console. Both use the theme returned by
parse_theme()
logging.Logger
, rich.Console
See also
Notes
The parser
is assumed to contain only the options related to
configuring the logger at the top level.
parse_theme
(parser)[source]¶Configure the rich style of logger and console output.
parser (configparser.ConfigParser
) – A parser containing any .cfg files in use.
The rich theme to be used by the manim logger.
rich.Theme
See also
set_file_logger
(config, verbosity)[source]¶Add a file handler to manim logger.
The path to the file is built using config.log_dir
.
config (ManimConfig
) – The global config, used to determine the log file path.
verbosity (str
) – The verbosity level of the logger.
None
Notes
Calling this function changes the verbosity of all handlers assigned to manim logger.