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

Add support for verbose trace level logging #1764

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

rh101
Copy link
Contributor

@rh101 rh101 commented Mar 25, 2024

Describe your changes

The most verbose log level at the moment is LogLevel::Debug, and while this serves its purpose, it is not suitable for trace-level logging, as it would end up with too much log spam, along with the possibility of revealing information that otherwise should not be revealed in a release/production version of an application.

This PR adds LogLevel::Trace, which is specifically for the purpose of verbose logging.

@halx99 If you accept this PR, do you want a color associated with the trace messages? If so, which color should be used for this?

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@halx99 halx99 added this to the 2.1.3 milestone Mar 25, 2024
@halx99
Copy link
Collaborator

halx99 commented Mar 25, 2024

about color, I think we can refer to spdlog.

@rh101
Copy link
Contributor Author

rh101 commented Mar 25, 2024

about color, I think we can refer to spdlog.

They seem to use white foreground color for the trace level \x1b[37m, which seems to be common for trace messages. I'll set it to that unless there are any objections.

Spdlog also uses cyan \x1b[36m for debug level. Should that be used too?

@rh101
Copy link
Contributor Author

rh101 commented Mar 25, 2024

Debug level output is set to cyan, and Trace level output is set to white, both of which seem to be used in other apps (spdlog and Android etc.)

@halx99 halx99 merged commit f0c0c75 into axmolengine:dev Mar 25, 2024
15 checks passed
@halx99 halx99 added the enhancement New feature or request label Mar 25, 2024
@rh101 rh101 deleted the support-log-trace branch March 25, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants