-
Notifications
You must be signed in to change notification settings - Fork 87
Logging
Nathan S edited this page Jul 18, 2020
·
3 revisions
The library has a very simple logging class that you can use to print text on the console. Keep in mind that you need to use nxlink to see them on Switch.
The fmt library is used for formatting. In short, use {}
as a placeholder (instead of the regular %s
, %d
...).
The Logger
class has three methods that either print text or do nothing depending on the current log level:
error()
info()
debug()
Three log levels are available:
ERROR
-
INFO
(default) DEBUG
These methods will not print anything if the current log level is lower than the method. It means that using info()
will not print anything if the log level is ERROR
. debug()
will not print anything if the log level is ERROR
or INFO
.
The method setLogLevel
allows to change the current log level.