1
0
Fork 0

this looks better (#8680)

This commit is contained in:
Jan 2019-04-04 15:51:40 +02:00 committed by GitHub
parent 9c0fb4a97e
commit 5d83eb7442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 14 deletions

View File

@ -429,12 +429,7 @@ format.
This can be fixed adjusting any existing log message parsers and making them aware
of the ID values. The ID values are always 5 byte strings, consisting of the characters
`[0-9a-f]`. ID values are placed directly behind the log level (e.g. `INFO`) for
general log messages that do not contain a log topic, and directly behind the log
topic for messages that contain a topic, e.g.
2019-03-25T21:23:19Z [8144] INFO [cf3f4] ArangoDB (version 3.5.0 enterprise [linux]) is ready for business. Have fun!.
2019-03-25T21:23:16Z [8144] INFO {authentication} [3844e] Authentication is turned on (system only), authentication for unix sockets is turned on
`[0-9a-f]`. ID values are placed directly behind the log level (e.g. `INFO`).
Alternatively, the log IDs can be suppressed in all log messages by setting the startup
option `--log.ids false` when starting arangod or any of the client tools.

View File

@ -67,25 +67,28 @@
#define ARANGO_INTERNAL_LOG_HELPER(id) \
::arangodb::Logger::LINE(__LINE__) \
<< ::arangodb::Logger::FILE(__FILE__) \
<< ::arangodb::Logger::FUNCTION(__FUNCTION__) \
<< ( ::arangodb::Logger::getShowIds() ? "[" id "] " : "" ))
<< ::arangodb::Logger::FUNCTION(__FUNCTION__)
#define LOG_TOPIC(id, level, logger) \
!::arangodb::Logger::isEnabled((::arangodb::LogLevel::level), (logger)) \
? (void)nullptr \
: ::arangodb::LogVoidify() & (::arangodb::LoggerStream() \
<< (::arangodb::LogLevel::level) << (logger) \
<< (::arangodb::LogLevel::level) \
<< ( ::arangodb::Logger::getShowIds() ? "[" id "] " : "" )) \
<< (logger) \
<< ARANGO_INTERNAL_LOG_HELPER(id)
////////////////////////////////////////////////////////////////////////////////
/// @brief logs a message for a topic given that a condition is true
////////////////////////////////////////////////////////////////////////////////
#define LOG_TOPIC_IF(id, level, logger, cond) \
!(arangodb::Logger::isEnabled((arangodb::LogLevel::level), (logger)) && (cond)) \
? (void)nullptr \
: ::arangodb::LogVoidify() & (arangodb::LoggerStream() \
<< (arangodb::LogLevel::level) << (logger) \
#define LOG_TOPIC_IF(id, level, logger, cond) \
!(::arangodb::Logger::isEnabled((::arangodb::LogLevel::level), (logger)) && (cond)) \
? (void)nullptr \
: ::arangodb::LogVoidify() & (::arangodb::LoggerStream() \
<< (::arangodb::LogLevel::level) \
<< ( ::arangodb::Logger::getShowIds() ? "[" id "] " : "" )) \
<< (logger) \
<< ARANGO_INTERNAL_LOG_HELPER(id)
////////////////////////////////////////////////////////////////////////////////