File logs for Sloth CI apps
Project description
Add file logging to Sloth CI apps.
You can customize your logging in a number of ways: set the output dir and filename, set log level and format, toggle and configure log rotation.
Installation
------------
.. code-block:: bash
$ pip install sloth-ci.ext.file_logs
Usage
-----
.. code-block:: yaml
:caption: file_logs.yml
extensions:
logs:
# Use the module sloth_ci.ext.file_logs.
module: file_logs
# Set the log path. Default is the current dir.
path: debug_logs
# Log filename. If not given, the app's listen point is used.
filename: test_debug.log
# Log level (number or valid Python logging level name).
level: DEBUG
# Log format (refer to the https://docs.python.org/3/library/logging.html#logrecord-attributes).
# By default, this format is used:
# format: '%(asctime)s | %(name)30s | %(levelname)10s | %(message)s'
# Make logs rotating. Default is false.
# rotating: true
# If rotating, maximum size of a log file in bytes.
# max_bytes: 500
# If rotating, maximum number or log files to keep.
# backup_count: 10
You can customize your logging in a number of ways: set the output dir and filename, set log level and format, toggle and configure log rotation.
Installation
------------
.. code-block:: bash
$ pip install sloth-ci.ext.file_logs
Usage
-----
.. code-block:: yaml
:caption: file_logs.yml
extensions:
logs:
# Use the module sloth_ci.ext.file_logs.
module: file_logs
# Set the log path. Default is the current dir.
path: debug_logs
# Log filename. If not given, the app's listen point is used.
filename: test_debug.log
# Log level (number or valid Python logging level name).
level: DEBUG
# Log format (refer to the https://docs.python.org/3/library/logging.html#logrecord-attributes).
# By default, this format is used:
# format: '%(asctime)s | %(name)30s | %(levelname)10s | %(message)s'
# Make logs rotating. Default is false.
# rotating: true
# If rotating, maximum size of a log file in bytes.
# max_bytes: 500
# If rotating, maximum number or log files to keep.
# backup_count: 10
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for sloth-ci.ext.file_logs-1.1.3.zip
Algorithm | Hash digest | |
---|---|---|
SHA256 | b186a4a0b129623b55a95161cf4ef5eff3c55a1631c351c26600dcaf9189c791 |
|
MD5 | 1ea3da2f471f327961226184a419eb20 |
|
BLAKE2b-256 | b78ceb6084dc8507cbbc5ba22fe9c506b734cbcd1009586e8244b3235b6ed796 |
Close
Hashes for sloth_ci.ext.file_logs-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6c55c7301c95db8fced956ecfaa7df1851da4fda40599a0c7c9acfadcfe99c9 |
|
MD5 | fd665fceee396357205136b08f1a950a |
|
BLAKE2b-256 | 2c69fef0bfdc576c329f80c2dedc261699ebf0153716777d2e0919525dc24dd8 |
Close
Hashes for sloth-ci.ext.file_logs-1.1.3.win-amd64.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06b06a1f83b48e8199e67b7815658b901b4ee376cd676e25f43d74f86c77b9d6 |
|
MD5 | 72257e9d825835ed48782a0918c34aed |
|
BLAKE2b-256 | 67ca3d08ea2422fc1f3b35148f187082398b83095e887409b7025408e5eb54e2 |