typerdrive Logging modules
typerdrive.logging.attach
Provide a decorator that attaches logging functionality to a typer
command function.
Attributes
Classes
Functions
attach_logging
attach_logging(
verbose: bool = False,
) -> Callable[
[ContextFunction[P, T]], ContextFunction[P, T]
]
Attach a logging functinoality to the decorated typer
command function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbose
|
bool
|
A |
False
|
Source code in src/typerdrive/logging/attach.py
get_logging_manager
Retrieve the LoggingManager
from the TyperdriveContext
.
Source code in src/typerdrive/logging/attach.py
typerdrive.logging.commands
Provide commands that can be added to a typer
app to manage logs.
Classes
Functions
add_audit
add_clear
add_logs_subcommand
Add all logs
commands to the given app.
Source code in src/typerdrive/logging/commands.py
add_show
audit
Show the log files retained for the app.
Source code in src/typerdrive/logging/commands.py
clear
Clear all the log files.
Source code in src/typerdrive/logging/commands.py
show
Show the current log.
typerdrive.logging.exceptions
Provide exceptions specific to the logging feature of typerdrive
.
Classes
LoggingError
Bases: TyperdriveError
The base exception for logging errors.
Source code in src/typerdrive/logging/exceptions.py
typerdrive.logging.manager
Provide a class for managing the typerdrive
logging feature.
Classes
LoggingManager
Manage logs for the typerdrive
app.
Source code in src/typerdrive/logging/manager.py
Attributes
Functions
__init__
Source code in src/typerdrive/logging/manager.py
audit
clear
Functions
typerdrive.logging.utilities
Provide utility functions useful for logging.
Functions
log_error
Log details of an error handled by the @handle_errors
decorator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
DoExceptParams
|
An instance of |
required |