Skip to content

Commit

Permalink
Add console logging back to Stator
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgodwin committed Nov 12, 2023
1 parent 476f817 commit ab3648e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stator/management/commands/runstator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ def handle(
):
# Cache system config
Config.system = Config.load_system()
logging.basicConfig(
format="[%(asctime)s] %(levelname)8s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
level=logging.INFO,
force=True,
)
# Resolve the models list into names
models = cast(
list[type[StatorModel]],
Expand Down

3 comments on commit ab3648e

@osmaa
Copy link
Contributor

@osmaa osmaa commented on ab3648e Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This made my stator logs quite verbose as it overrides my logging config. Is that force=True really required?

@andrewgodwin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we need to force it here as otherwise the logging config from elsewhere takes over and nothing prints to the Stator console at all.

If you can find a way to preserve the Stator logging behaviour out of the box (logging every transition and scheduling run) without it, go for it.

@osmaa
Copy link
Contributor

@osmaa osmaa commented on ab3648e Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made #674 that should provide logging configurability to stator as desired.

Please sign in to comment.