Skip to content

Add a custom log level for user messages #361

Description

@rwb27

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions