converter.cli
¶
Module Contents¶
Classes¶
Changes the color of the log message based on the log level. Errors are |
|
Sends the log message onto click.echo |
Functions¶
|
Sets up the logging config for the console and files |
|
Initialises the cli grouping with default options. |
|
Prints the resolved config to the console |
|
Runs the data conversion |
- class converter.cli.ColorFormatter(fmt=None, datefmt=None, style='%', validate=True)¶
Bases:
logging.Formatter
Changes the color of the log message based on the log level. Errors are red, warnings are yellow and debug messages are blue.
- Parameters
colors – Mapping of log level to colors
- colors¶
- format(self, record) str ¶
Adds the color to the log message.
- Parameters
record – The record to format
- Returns
The formatted message
- class converter.cli.ClickEchoHandler(level=NOTSET)¶
Bases:
logging.Handler
Sends the log message onto click.echo
- emit(self, record)¶
Do whatever it takes to actually log the specified logging record.
This version is intended to be implemented by subclasses and so raises a NotImplementedError.
- converter.cli.init_logging(verbosity, no_color)¶
Sets up the logging config for the console and files
- Parameters
verbosity – The verbosity level 0 - errors and warnings only 1 - info 2 - debug
no_color – Don’t add the color to the output
- converter.cli.cli(ctx, config, verbose, no_color, option)¶
Initialises the cli grouping with default options.
- converter.cli.show_config(ctx)¶
Prints the resolved config to the console
- converter.cli.run(ctx)¶
Runs the data conversion