Skip to content

Add a custom log level for user messages #361

@rwb27

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions