Skip to content

Made to replace Python's importable Logging lib because it didnt work how i wanted it to, and kept not actually writing logs to a file

License

Notifications You must be signed in to change notification settings

CharGoldenYT/betterLogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Char's Better Logs

A project started to fix a problem I was having with the default python logging library

USAGE

Simply install it with pip install chars-betterlogs and add it to your code with:

from chars_betterlogs.logs import Logging

then make a variable:

#                         The Filename         String to add before the log        Whether to print the log (Defaults to True)
logger:Logging = Logging('filename.log', 'This gets added before the log starts!', False)

Tada you now have a callable logger!

Example Script

from chars_betterlogs.logs import Logging
from datetime import datetime

logger:Logging = Logging('log_' + str(datetime.today().strftime('%d_%m_%Y-%H_%M_%S')) + '.log')

logger.log_info('yipee!')
logger.close() # Don't forget to end the log file before the script ends!

About

Made to replace Python's importable Logging lib because it didnt work how i wanted it to, and kept not actually writing logs to a file

Resources

License

Stars

Watchers

Forks