telemetry
Class info¶
Classes¶
Name | Children | Inherits |
---|---|---|
PrefixedLogger mkdocs_mknodes.telemetry A logger adapter to prefix log messages. |
🛈 DocStrings¶
PrefixedLogger
¶
Bases: LoggerAdapter
A logger adapter to prefix log messages.
Source code in mkdocs_mknodes/telemetry.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
__init__
¶
Initialize the logger adapter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix
|
str
|
The string to insert in front of every message. |
required |
logger
|
Logger
|
The logger instance. |
required |
Source code in mkdocs_mknodes/telemetry.py
52 53 54 55 56 57 58 59 60 |
|
process
¶
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 mkdocs_mknodes/telemetry.py
62 63 64 65 66 67 68 69 70 71 72 |
|
get_plugin_logger
¶
get_plugin_logger(name: str) -> PrefixedLogger
Return a logger for plugins.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name to use with |
required |
Returns:
Type | Description |
---|---|
PrefixedLogger
|
A logger configured to work well in MkDocs, prefixing each message with the plugin package name. |
Example
from mkdocs.plugins import get_plugin_logger
log = get_plugin_logger(__name__)
log.info("My plugin message")
Source code in mkdocs_mknodes/telemetry.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|