Currently, we use Thing.logger.info() to relay messages to the user from long-running actions. It would be nice to add a log level between INFO and WARNING that is used for messages that ought to be displayed in the front-end.
This would probably entail making Thing.logger return a subclass of logging.Logger with a new method for the custom level.
It would additionally be helpful to add a function that returns a subclassed Logger pointing at labthings_fastapi.logs.THING_LOGGER so it can be used by "thing-adjacent" code that's not part of a Thing.
Currently, we use
Thing.logger.info()to relay messages to the user from long-running actions. It would be nice to add a log level betweenINFOandWARNINGthat is used for messages that ought to be displayed in the front-end.This would probably entail making
Thing.loggerreturn a subclass oflogging.Loggerwith a new method for the custom level.It would additionally be helpful to add a function that returns a subclassed
Loggerpointing atlabthings_fastapi.logs.THING_LOGGERso it can be used by "thing-adjacent" code that's not part of a Thing.