Skip to content

smartswap-org/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger

A simple logging system with colored output and daily file rotation.

Installation

git clone https://github.com/smartswap-org/logger
cd logger
pip install -e .

Basic Usage

from logger import log, LogLevel

# Log messages with different severity levels
log.info("Information message")
log.error("Error message")
log.debug("Debug information")

# Set minimum log level
log.min_level = LogLevel.ERROR  # Only show ERROR and above

# Enable file logging
log.enable_file_logging()  # Logs to logs/YYYY-MM-DD.log
log.enable_file_logging(log_dir="custom_logs")  # Custom directory
log.disable_file_logging()  # Stop file logging

# Create custom logger
custom_log = Logger(min_level=LogLevel.DEBUG, log_to_file=True, log_dir="app_logs")

Testing & Demo

python run_tests.py  # Run tests
python demo.py       # Run demo

License

MIT

About

A logging library for Python with colored output and daily log.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Contributors

Languages