@@ -23,14 +23,14 @@ variables, e.g. the log level.
2323
2424| LogLevel | Usage |
2525| ----------| -------|
26- | FATAL | For fatal and non-recoverable errors which essentially lead to termination of the program. |
27- | ERROR | For severe but recoverable errors. |
28- | WARN | For cases when something unintentional happens which is not considered a severe error. |
29- | INFO | Anything which could be relevant for the daily user. |
30- | DEBUG | Anything that is helpful for debugging, i.e. the info log level for the fellow developer. |
31- | TRACE | Anything that might be helpful for debugging in some cases but would be too verbose for debug log level. |
32-
33- The log levels ` FATAL ` , ` ERROR ` and ` WARN ` should not be used independently but
26+ | Fatal | For fatal and non-recoverable errors which essentially lead to termination of the program. |
27+ | Error | For severe but recoverable errors. |
28+ | Warn | For cases when something unintentional happens which is not considered a severe error. |
29+ | Info | Anything which could be relevant for the daily user. |
30+ | Debug | Anything that is helpful for debugging, i.e. the info log level for the fellow developer. |
31+ | Trace | Anything that might be helpful for debugging in some cases but would be too verbose for debug log level. |
32+
33+ The log levels ` Fatal ` , ` Error ` and ` Warn ` should not be used independently but
3434in combination with the error handler and vice versa.
3535
3636## Design
@@ -146,14 +146,14 @@ logger, independent of the active log level.
146146
147147The ` IOX_LOG_INTERNAL ` calls ` self() ` on the ` LogStream ` instance to create an lvalue
148148reference to the ` LogStream ` instance. This eases the implementation of logging
149- support for custom types since ` IOX_LOG(INFO , myType); ` would require to implement
150- an overload with a rvalue ` LogStream ` reference but ` IOX_LOG(INFO , "#### " << myType); `
149+ support for custom types since ` IOX_LOG(Info , myType); ` would require to implement
150+ an overload with a rvalue ` LogStream ` reference but ` IOX_LOG(Info , "#### " << myType); `
151151requires a lvalue reference.
152152
153153#### Behavior before calling Logger::init
154154
155155In order to have log messages before ` Logger::init ` is called, the default logger
156- is used with ` LogLevel::INFO ` . It is up to the implementation of the default
156+ is used with ` LogLevel::Info ` . It is up to the implementation of the default
157157logger what to do with these messages. For iceoryx the default logger is the
158158` ConsoleLogger ` (this can be changed via the platform abstraction) which will
159159print the log messages to the console.
@@ -269,11 +269,11 @@ This is the sequence diagram of the setup of the testing logger:
269269The behavior of the logger can be altered via environment variables and the
270270`Logger::init` function. Calling this function without arguments, it will check
271271whether the environment variable `IOX_LOG_LEVEL` is set and use that value or
272- `LogLevel::INFO ` if the environment variable is not set. To have a different
272+ `LogLevel::Info ` if the environment variable is not set. To have a different
273273fallback log level, the `logLevelFromEnvOr` function can be used, e.g.
274274
275275```cpp
276- iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::DEBUG ));
276+ iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::Debug ));
277277```
278278
279279If the logger shall not be altered via environment variables, ` Logger::init ` must
@@ -303,9 +303,9 @@ re-implemented via the platform abstraction.
303303
304304int main ()
305305{
306- iox::log::Logger::init (iox::log::logLevelFromEnvOr (iox::log::LogLevel::DEBUG ));
306+ iox::log::Logger::init (iox::log::logLevelFromEnvOr (iox::log::LogLevel::Debug ));
307307
308- IOX_LOG (DEBUG , "Hello World");
308+ IOX_LOG (Debug , "Hello World");
309309
310310 return 0;
311311}
@@ -333,7 +333,7 @@ iox::log::LogStream& operator<<(iox::log::LogStream& stream, const MyType& m)
333333int main ()
334334{
335335 MyType m;
336- IOX_LOG (INFO , m);
336+ IOX_LOG (Info , m);
337337
338338 return 0;
339339}
@@ -355,7 +355,7 @@ class MyLogger : public iox::log::Logger
355355 {
356356 static MyLogger myLogger;
357357 iox::log::Logger::setActiveLogger(myLogger);
358- iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::INFO ));
358+ iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::Info ));
359359 }
360360
361361 private:
@@ -366,22 +366,22 @@ class MyLogger : public iox::log::Logger
366366 iox::log::LogLevel logLevel) noexcept override
367367 {
368368 switch(logLevel) {
369- case iox::log::LogLevel::FATAL :
369+ case iox::log::LogLevel::Fatal :
370370 logString("💀: ");
371371 break;
372- case iox::log::LogLevel::ERROR :
372+ case iox::log::LogLevel::Error :
373373 logString("🙈: ");
374374 break;
375- case iox::log::LogLevel::WARN :
375+ case iox::log::LogLevel::Warn :
376376 logString("🙀: ");
377377 break;
378- case iox::log::LogLevel::INFO :
378+ case iox::log::LogLevel::Info :
379379 logString("💘: ");
380380 break;
381- case iox::log::LogLevel::DEBUG :
381+ case iox::log::LogLevel::Debug :
382382 logString("🐞: ");
383383 break;
384- case iox::log::LogLevel::TRACE :
384+ case iox::log::LogLevel::Trace :
385385 logString("🐾: ");
386386 break;
387387 default:
@@ -399,12 +399,12 @@ int main()
399399{
400400 MyLogger::init();
401401
402- IOX_LOG(FATAL , "Whoops ... look, over there is a dead seagull flying!");
403- IOX_LOG(ERROR , "Oh no!");
404- IOX_LOG(WARN , "It didn't happen!");
405- IOX_LOG(INFO , "All glory to the hypnotoad!");
406- IOX_LOG(DEBUG , "I didn't do it!");
407- IOX_LOG(TRACE , "Row row row your boat!");
402+ IOX_LOG(Fatal , "Whoops ... look, over there is a dead seagull flying!");
403+ IOX_LOG(Error , "Oh no!");
404+ IOX_LOG(Warn , "It didn't happen!");
405+ IOX_LOG(Info , "All glory to the hypnotoad!");
406+ IOX_LOG(Debug , "I didn't do it!");
407+ IOX_LOG(Trace , "Row row row your boat!");
408408
409409 return 0;
410410}
@@ -420,9 +420,9 @@ int main()
420420 log messages when the signal is raised? It might be necessary to wait for the
421421 error handling refactoring before this can be done
422422- instead of having the `Logger::init()` static function with hidden default
423- parameter this could be replaced by `Logger::init(LogLevel::WARN )`,
424- `Logger::initFromEnvOr(LogLevel::WARN )` and a builder like
425- `Logger::customize().logLevelFromEnvOr(LogLevel::WARN ).init()`
423+ parameter this could be replaced by `Logger::init(LogLevel::Warn )`,
424+ `Logger::initFromEnvOr(LogLevel::Warn )` and a builder like
425+ `Logger::customize().logLevelFromEnvOr(LogLevel::Warn ).init()`
426426- wrap `__FILE__`, `__LINE__` and `__FUNCTION__` into a `source_location` struct
427427 - where should this struct be placed
428428 - could also be used by `IOX_EXPECTS`, `IOX_ENSURES`
0 commit comments