aboutsummaryrefslogtreecommitdiff
path: root/src/test/logging_tests.cpp
AgeCommit message (Collapse)Author
2023-12-20logging: add LogError, LogWarning, LogInfo, LogDebug, LogTraceAnthony Towns
These provide simple and clear ways to write the most common logging operations: LogInfo("msg"); LogDebug(BCLog::LogFlags::NET, "msg"); LogError("msg"); LogWarning("msg"); LogTrace(BCLog::LogFlags::NET, "msg"); For cases where the level cannot be hardcoded, LogPrintLevel(category, level, ...) remains available.
2023-12-15logging: treat BCLog::ALL like BCLog::NONEAnthony Towns
2023-12-15logging: Drop BCLog::Level::NoneAnthony Towns
Now that Info-level logging is always logged, there is no further need for the "None" level, so remove it.
2023-12-15logging: make [cat:debug] and [info] implicitAnthony Towns
2023-12-15logging: refactor: pull prefix code outAnthony Towns
2023-08-03refactor: fix unterminated LogPrintf()sfanquake
2023-06-14init: raise on invalid loglevel config optionJon Atack
2023-01-31Use steady clock for logging timerMarcoFalke
2022-12-24scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: - 2021: f47dda2c58b5d8d623e0e7ff4e74bc352dfa83d7 - 2020: fa0074e2d82928016a43ca408717154a1c70a4db - 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2022-08-20Create BCLog::Level::Trace log severity levelJon Atack
for verbose log messages for development or debugging only, as bitcoind may run more slowly, that are more granular/frequent than the Debug log level, i.e. for very high-frequency, low-level messages to be logged distinctly from higher-level, less-frequent debug logging that could still be usable in production. An example would be to log higher-level peer events (connection, disconnection, misbehavior, eviction) as Debug, versus Trace for low-level, high-volume p2p messages in the BCLog::NET category. This will enable the user to log only the former without the latter, in order to focus on high-level peer management events. With respect to the name, "trace" is suggested as the most granular level in resources like the following: - https://sematext.com/blog/logging-levels - https://howtodoinjava.com/log4j2/logging-levels Update the test framework and add test coverage.
2022-08-20Unit test coverage for -loglevel configuration optionklementtan
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20Unit test coverage for log severity levelsklementtan
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-08-20Update LogAcceptCategory() and unit tests with log severity levelsklementtan
Co-authored-by: "Jon Atack <jon@atack.com>"
2022-06-08logging: add LogPrintfCategory to log unconditionally with categoryJon Atack
prefixing the output with the passed category name. - add documentation - add a unit test - update lint-logs.py - update lint-format-strings.py
2022-05-25refactor: Change LogPrintLevel order to category, severitylaanwj
This is more consistent with the other functions, as well as with the logging output itself. If we want to make this change, we should do it before it's all over the place.
2022-05-19logging: Add severity level to logs.klementtan
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-09-07Make unexpected time type in BCLog::LogMsg() a compile-time errorMartin Ankerl
2021-09-07log, timer: improve BCLog::LogMsg()Jon Atack
- make timer code more homogeneous - replace division with multiplication - log if the time type is unexpected
2021-09-01log, timer: add timing macro in usec LOG_TIME_MICROS_WITH_CATEGORYJon Atack
and update BCLog::LogMsg() to omit irrelevant decimals for microseconds and skip unneeded code and math.
2021-04-14test: Reset mocktime in the common setupMarcoFalke
Doing it there will reduce code bloat and also ensure no test can "forget" to reset it
2019-11-06scripted-diff: test: Move setup_common to test libraryMarcoFalke
-BEGIN VERIFY SCRIPT- # Move files for f in $(git ls-files src/test/lib/); do git mv $f src/test/util/; done git mv src/test/setup_common.cpp src/test/util/ git mv src/test/setup_common.h src/test/util/ # Replace Windows paths sed -i -e 's|\\setup_common|\\util\\setup_common|g' $(git grep -l '\\setup_common') sed -i -e 's|src\\test\\lib\\|src\\test\\util\\|g' build_msvc/test_bitcoin/test_bitcoin.vcxproj # Everything else sed -i -e 's|/setup_common|/util/setup_common|g' $(git grep -l 'setup_common') sed -i -e 's|test/lib/|test/util/|g' $(git grep -l 'test/lib/') # Fix include guard sed -i -e 's|BITCOIN_TEST_SETUP_COMMON_H|BITCOIN_TEST_UTIL_SETUP_COMMON_H|g' ./src/test/util/setup_common.h sed -i -e 's|BITCOIN_TEST_LIB_|BITCOIN_TEST_UTIL_|g' $(git grep -l 'BITCOIN_TEST_LIB_') -END VERIFY SCRIPT-
2019-11-04logs: add BCLog::Timer and related macrosJames O'Beirne
Makes logging timing information about a block of code easier.