python logging client for SmartDash
Project description
from smartlogger import SmartTimer
timer = SmartTimer(NAME, save_to_dir="./")
timer.start(unique_id)
timer.start(unique_id, stage="pre_processing")
# code
timer.finished(unique_id, stage="pre_processing")
# if failed
timer.failed(unique_id, stage="pre_processing")
timer.start(unique_id, stage="feature_extraction")
# code
timer.finished(unique_id, stage="feature_extraction")
# if failed
timer.failed(unique_id, stage="feature_extraction")
timer.finished(unique_id)
from smartlogger import SmartLogger
# Initialize a SmartLogger instance
logger = SmartLogger("my_application", save_to_dir="./logs")
# Use the SmartLogger instance to log messages with different log levels
# Log a debug message without stage
logger.debug("id_1", "This is a debug message.")
# Log a debug message with stage
logger.debug("id_2", "This is a debug message with stage.", stage="data_processing")
# Log an info message with stage
logger.info("id_4", "This is an info message with stage.", stage="model_training")
# Log an exception message without stage
try:
raise ValueError("This is a ValueError.")
except ValueError as e:
logger.exception("id_7", "An exception occurred:", e)
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
smartlogger-0.0.1.dev8.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for smartlogger-0.0.1.dev8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dce3c7a0cfe001bc4b584574969b028e6afcd6e4e2abd832c20af7d41aa9225 |
|
MD5 | e3579b960d8659598678055249a337e5 |
|
BLAKE2b-256 | 45116276e34c68c115b2a7699183a0e9d9ede645ef2ef5dc92b77f6e1c7326a9 |