Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor MinimalLogger / Disable by Default #612

Open
derks opened this issue Oct 1, 2021 · 2 comments
Open

Refactor MinimalLogger / Disable by Default #612

derks opened this issue Oct 1, 2021 · 2 comments

Comments

@derks
Copy link
Member

derks commented Oct 1, 2021

The minimal logger is documented in multiple places as the "framework logger" and "should only be used by the framework". This is also one of the few places where a hardcoded look for --debug is. I want to disable framework logging by default, and remove the look for --debug... as this should really only be used by core and extensions and should only log DEBUG... backward compatibility should not be an issue.

  1. Set App.meta.framework_logging = False
  2. Support additional variables:
    • CEMENT_LOG - Enabled/disabled (1 = 'enabled', disabled by default)
    • CEMENT_LOG_LEVEL - Logging level (INFO by default)
    • CEMENT_LOG_FILE - Path to log file (None by default)
    • CEMENT_LOG_CONSOLE - Enabled/disabled (1 = 'enabled', default)

Related:

Notes:

  • Need to maintain CEMENT_FRAMEWORK_LOGGING for backward-compat.
@derks derks added this to the 3.0.6 Stable milestone Oct 1, 2021
@derks derks modified the milestones: 3.0.6 Stable, 3.0.8 Stable Dec 18, 2021
@derks
Copy link
Member Author

derks commented Jul 5, 2022

Triggering Cement logging based on --debug is deprecated in 3.0.8, and will be removed in 3.2.0. This will be documented at:

derks added a commit that referenced this issue Jul 5, 2022
- Resolves Issue #612 (partial)
- Resolves Issue #613
- Resolves Issue #631
- Resolves Issue #638
@derks derks modified the milestones: 3.0.8 Stable, 3.0.10 Stable Aug 18, 2022
@derks derks modified the milestones: 3.0.10 Stable, 3.2.0 Stable Feb 17, 2023
@TomFreudenberg
Copy link
Contributor

Hi @derks

just to get in touch here with you, I do not understand your idea.

Let's try to state something out:

a. You want to make logging configurable
b. You want to support framework logging and app logging
c. You want to make logging debug or quite or whatever
d. You want to allow "higher" logger like colorlog

My question is why you want to want to differ between framework and app logging

Isn't it that you want debug level overall if you you need?

For my opinion the framework should be suggested as being stable - So for an app developer it is not a point to LOG something from framework in anyway.

But if the framework decide to print some debug logs it has to be noticed by the app developer as well.

Saying that I think, that the number of LOG output from framewrk should be very rare. But if they are set, they should appear in any way.

So if one enables DEBUG, it should printout also the framework logs. And if I configure a special logger, I want to have all logs catched by it.

So for that, I would prefer to only log via app.log and only if set. If someone does not set a logger, than ther should be no log.

My 2 cents on that

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

No branches or pull requests

2 participants