loggers
Logging functions.
LoggerAdapter(prefix, logger)
¤
Bases: logging.LoggerAdapter
A logger adapter to prefix messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
str
|
The string to insert in front of every message. |
required |
logger |
logging.Logger
|
The logger instance. |
required |
Source code in mkdocstrings/loggers.py
27 28 29 30 31 32 33 34 35 |
|
process(msg, kwargs)
¤
Process the message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg |
str
|
The message: |
required |
kwargs |
MutableMapping[str, Any]
|
Remaining arguments. |
required |
Returns:
Type | Description |
---|---|
Tuple[str, Any]
|
The processed message. |
Source code in mkdocstrings/loggers.py
37 38 39 40 41 42 43 44 45 46 47 |
|
TemplateLogger(logger)
¤
A wrapper class to allow logging in templates.
Attributes:
Name | Type | Description |
---|---|---|
debug |
Function to log a DEBUG message. |
|
info |
Function to log an INFO message. |
|
warning |
Function to log a WARNING message. |
|
error |
Function to log an ERROR message. |
|
critical |
Function to log a CRITICAL message. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logger |
LoggerAdapter
|
A logger adapter. |
required |
Source code in mkdocstrings/loggers.py
61 62 63 64 65 66 67 68 69 70 71 |
|
get_logger(name)
¤
Return a pre-configured logger.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name to use with |
required |
Returns:
Type | Description |
---|---|
LoggerAdapter
|
A logger configured to work well in MkDocs. |
Source code in mkdocstrings/loggers.py
123 124 125 126 127 128 129 130 131 132 133 134 |
|
get_template_logger()
¤
Return a logger usable in templates.
Returns:
Type | Description |
---|---|
TemplateLogger
|
A template logger. |
Source code in mkdocstrings/loggers.py
137 138 139 140 141 142 143 |
|
get_template_logger_function(logger_func)
¤
Create a wrapper function that automatically receives the Jinja template context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logger_func |
Callable
|
The logger function to use within the wrapper. |
required |
Returns:
Type | Description |
---|---|
Callable
|
A function. |
Source code in mkdocstrings/loggers.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
get_template_path(context)
¤
Return the path to the template currently using the given context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context |
Context
|
The template context. |
required |
Returns:
Type | Description |
---|---|
str
|
The relative path to the template. |
Source code in mkdocstrings/loggers.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|