ActiveLog
A simple logging utility for Python.
Usage
Description of Constructors's Argument
| name | Description |
|---|---|
| shift_freq | frequency of log file rotation. [sec] |
| shift_size | file size of log file rotation. [byte] |
| level | Logging severity threshold. Default values is logger.DEBUG |
| init | Whether to clear log files. [True / False] |
| datetime_format | Date and time format. Default value is '%Y-%m-%d %H:%M:%S.%f'. |
| shift_period_suffix | The log file suffix format for rotation. Default is '_%Y-%m-%d'. |
Simple Example
from activelog import Logger
# Create a Logger that prints to STDOUT
log = Logger(Logger.STDOUT)
log.debug("Created Logger")
log.info("Program finished")
# Create a Logger that prints to Log File
log = Logger('log file path')
log.warn("This is WARN message")
log.error("This is ERROR message")
Log File Shift Example
# Switch log file daily
log = Logger('log file path', shift_freq=60*60*24)
# Switch log file weekly
log = Logger('log file path', shift_freq=60*60*24*7)
# Switch log file every 10MB
log = Logger('log file path', shift_size=100000000)
Output Example
[2020-01-01 07:11:09.887267 #sample.py line:4] INFO -- : Program Start!!
[2020-01-01 07:11:23.535936 #sample.py line:9] ERROR -- : Program End...
Installation
$ pip install activelog
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/AjxLab/ActiveLog.
Metadata
Release files for activelog 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| activelog-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for activelog-1.0.1-py3-none-any.whl |
Release files / activelog-1.0.1-py3-none-any.whl
| Download URL | activelog-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c642956eb4268786ac3dd1ba2164c38faf933e75b1994c5f0e90082e5af305e9
|
|
BLAKE2b-256 checksum How to use checksums |
fb15eb43f8dc28930ce999484a5ff49fb06ecf54e8d6900a034630ddb28960b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4
|
Security for activelog 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.