Closed nitanmarcel closed 2 months ago
I've added childers to the loggers. for example for openai requests it will show the prefix r2ai.openai
r2ai being the base and openai the endpoint used. and I removed the KWSPLITRESPONSE completly. since it can be identified by the log tags
WAAAIT I just saw something
since we already have rich and it has a nice handler to make the logging pop more with colors based on their level
^
can you redo? for some reason they don't show up for me..
Checklist
Description
Makes use of python's built-in logging library to control which logs get displayed based on an environment variable.
Right now it's a base, and it need to be revised based on what where should go.
Built-in commands are:
LOGGING.debug LOGGING.info LOGGING.warn LOGGING.error LOGGING.critical
The levels can be controlled at runtime via the -V command, or by R2API_LOG= environment.
Option to also push to a file exists with R2AI_LOGFILE=.
I'm thinking of making it push to both file and console by default and give r2ai it's own directory in .local. appdirs could make picking up directories easier but can be done manually too.
The logs will be structured/session with names like, r2ai.log (for last session), r2ai.log.1, r2ai.log.2 etc.
What do you think? Maybe also move everything else to it's own config file