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 human-readable logging infrastructure #44

Closed
charmoniumQ opened this issue Jul 26, 2020 · 0 comments
Closed

Add human-readable logging infrastructure #44

charmoniumQ opened this issue Jul 26, 2020 · 0 comments
Labels
design decision Something we need public deliberation on feature New feature or request good first issue Good for newcomers

Comments

@charmoniumQ
Copy link
Member

charmoniumQ commented Jul 26, 2020

Our record_logger and the CPU timers in #209/#211 are good for computer-readable telemetry. However, we need an infrastructure for data intended to get to a user, such as warnings, error descriptions, and debugging messages.

Perhaps, we should use glog.

  • By default, ILLIXR should not print anything except for really critical stuff (why this is considered "good UNIX style")
    • Logs in a loop can use something like glog's LOG_EVERY_N.
  • Many of the assert(thing && msg) can be replaced with glog's CHECK(thing) << msg.
    • This permits the message to be a dynamically generated string, like CHECK(thing) << getErrorMessage(msg) which would not work with a raw assert.
    • CHECK is not suppressed by NDEBUG, which has caused us bugs in the past (and pesky [[maybe_unused]] annotations).
      • One can still explicitly reserve a check for debug builds by surrounding the CHECK with #ifndef NDEBUG, as we do already in many places (e.g. common/record_logger.hpp).
  • Glog can dump the stacktrace on segfault.
    • We do already have catchsegv. There's not a whole lot of benefit to switching over to glog for that.
  • Glog embeds the filename and line number in all logs.
  • Perhaps we want to "selectively enable" debug flags for different plugins, as in LLVM. This is the only thing not readily avilable in glog.
@charmoniumQ charmoniumQ created this issue from a note in ILLIXR improvements (Backlog) Jul 26, 2020
@charmoniumQ charmoniumQ added design decision Something we need public deliberation on feature New feature or request good first issue Good for newcomers labels Jul 26, 2020
@charmoniumQ charmoniumQ changed the title Create a stdout logging infrastructure Add human-readable logging infrastructure Mar 3, 2021
This was referenced Mar 3, 2021
@astro-friedel astro-friedel linked a pull request Aug 18, 2023 that will close this issue
ILLIXR improvements automation moved this from Issue Backlog to Done Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design decision Something we need public deliberation on feature New feature or request good first issue Good for newcomers
Projects
Development

Successfully merging a pull request may close this issue.

2 participants