A generic logging class
Project description
Generic Logger
A generic logging class for Python
Basic setup and usage are simple. Just import the class and create a Logger instance with a location to save the log file, it will handle everything else!
The log files will even be capped at a configurable limit and rotated after they have reached the limit.
To install: Download the source files as an archive and extract them on your computer.
Next run the install command:
python setup.py install
Usage:
from logger import Logger
def main():
log = Logger("./logs/test.log")
log.info("This is a test...")
log.warning("I know what you did last summer...")
if __name__ == "__main__":
main()
Attributes
- Log File Location
- Logger Name (Default: Calling script)
- Max Log File Size {in Megabytes} (Default: 1 MB)
- Log File Backup Count (Default: 3)
- Logging Level (Default: INFO)
- Log Format (Default: %(levelname)s: [%(name)s]: %(asctime)s - %(message)s)
- Date Format (Default: %m/%d/%Y %H:%M:%S)
All attributes are configurable, and all except log file location have default values.
Logging Levels
- DEBUG
- INFO
- WARNING
- ERROR
- CRITICAL
Log File Output Example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rm_logger-0.0.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for rm_logger-0.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fef345a4ac8f280ea33e08e7a9f8bbd9cb6c535901aa2abaa4cbb38bfb9d17c7 |
|
MD5 | 838731cc83636efb2140d2f713519fd8 |
|
BLAKE2b-256 | 453576eadcade28f4952fd5182130ae36b95e0adb4f82d6f49a5f29474521a7a |