Jamster3000 / Joan-smart-assistant

A smart assistant built purly in python. Uses different machine learning models to keep up speed and efficiency for lower resourced devices.
1 stars 0 forks source link

Logging #14

Closed Jamster3000 closed 1 day ago

Jamster3000 commented 6 months ago

add efficient logging to everything in the code everywhere.

example

import logging

# Create a custom logger
logger = logging.getLogger(__name__)

# Set the logging level
logger.setLevel(logging.DEBUG)

# Create a file handler
handler = logging.FileHandler('app.log')

# Create a formatter
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(funcName)s - %(lineno)d - %(message)s')

# Add the formatter to the handler
handler.setFormatter(formatter)

# Add the handler to the logger
logger.addHandler(handler)

# Log a debug message
logger.debug('This is a debug message')