-
Notifications
You must be signed in to change notification settings - Fork 10
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
Replace logging implementation with spdlog #1093
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Always have logging enabled.
Add command-line options --pika:log-destination, --pika:log-level, and --pika:log-format to correspond to PIKA_LOGDESTINATION, PIKA_LOGLEVEL, and PIKA_LOGFORMAT. Logging is always enabled, at level warning.
Performance test reportpika PerformanceComparison
Info
Explanation of Symbols
|
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
May 6, 2024
Performance test reportpika PerformanceComparison
Info
Explanation of Symbols
|
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
May 7, 2024
This was referenced May 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This replaces the internal (boost logging-based) logging implementation with spdlog (https://github.com/gabime/spdlog). At the same time I've noticeably simplified the logging setup.
Compared to before, there is only one log now which can be used with
PIKA_LOG(level, "msg {}", arg)
. Logging is done tostderr
by default. The default log level is warnings and more severe. The default logging output looks like this now (a snippet fromhello_world
):pika
is always printed first (useful to users who might not know that pika is running under the hood, at least they have something to search for)pika/libs/pika/debugging/include/pika/debugging/print.hpp
Lines 280 to 287 in adb63f0
%P
and%t
from https://github.com/gabime/spdlog/wiki/3.-Custom-formatting#pattern-flags)<pool num>/<global thread num>/<local thread num>
.----
is printed when any of them is not set.thread_id
formatter.The log format is customizable with
PIKA_LOG_FORMAT
or--pika:log-format
. The pika information (thread ids, hostname, worker thread information) is implemented using custom spdlog formatters.The log level follows spdlog's log levels, from 0 (trace) to 6 (off) and can be set with
PIKA_LOG_LEVEL
or--pika:log-level
.The destination can be set with
PIKA_LOG_DESTINATION
or--pika:log-destination
, and defaults tocerr
. This can becerr
orcout
for stderr and stdout, or a file otherwise.