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

New logger #638

Merged
merged 4 commits into from
Oct 29, 2021
Merged

New logger #638

merged 4 commits into from
Oct 29, 2021

Conversation

vyzo
Copy link
Collaborator

@vyzo vyzo commented Oct 25, 2021

Rewrites the std/logger library for better logging, allowing per source thresholds to control verbosity.

@vyzo vyzo requested a review from fare October 25, 2021 09:53
@vyzo vyzo merged commit 87c6279 into master Oct 29, 2021
@vyzo vyzo deleted the new-logger branch October 29, 2021 08:30
@fare
Copy link
Collaborator

fare commented Nov 19, 2021

Can we leave some backward-compatible function log-error around? It seems to be used a lot still.


::: tip usage
There are 5 pre-defined levels:
- ERROR (0) -- indicates an error condition in the program.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're that close, shouldn't we accept the same levels as the syslog(3) facility?

Values for level
  This determines the importance of the message.  The levels are, in  order  of  decreasing  importance:
    LOG_EMERG      system is unusable
    LOG_ALERT      action must be taken immediately
    LOG_CRIT       critical conditions
    LOG_ERR        error conditions
    LOG_WARNING    warning conditions
    LOG_NOTICE     normal, but significant, condition
    LOG_INFO       informational message
    LOG_DEBUG      debug-level message

I see that on Linux, /usr/include/sys/syslog.h just imports the arch-dependent value from /usr/include/x86_64-linux-gnu/sys/syslog.h, that has:

#define LOG_EMERG       0       /* system is unusable */
#define LOG_ALERT       1       /* action must be taken immediately */
#define LOG_CRIT        2       /* critical conditions */
#define LOG_ERR         3       /* error conditions */
#define LOG_WARNING     4       /* warning conditions */
#define LOG_NOTICE      5       /* normal but significant condition */
#define LOG_INFO        6       /* informational */
#define LOG_DEBUG       7       /* debug-level messages */

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

Successfully merging this pull request may close these issues.

2 participants