tools:logger:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tools:logger:start [2018/05/25 09:28] – [Default LogWriter] graf | tools:logger:start [2020/11/26 13:04] – [Logging into the Console and into a File] ursgraf | ||
---|---|---|---|
Line 3: | Line 3: | ||
<code cpp> | <code cpp> | ||
- | | + | |
- | Logger log; | + | Logger log = Logger:: |
- | log.set(w); | + | |
| | ||
log.info() << " | log.info() << " | ||
Line 16: | Line 15: | ||
While declaring a logger you can choose a category for it which is a single capital letter, see below: | While declaring a logger you can choose a category for it which is a single capital letter, see below: | ||
<code cpp> | <code cpp> | ||
- | Logger log1(); | + | Logger log1 = Logger:: |
- | Logger log2(' | + | Logger log2 = Logger:: |
</ | </ | ||
Line 27: | Line 26: | ||
* ERROR | * ERROR | ||
* FATAL: highest level | * FATAL: highest level | ||
- | Every '' | + | Every '' |
<code cpp> | <code cpp> | ||
- | | + | |
- | w.show(LogLevel:: | + | |
</ | </ | ||
This would enable levels WARN, ERROR and FATAL. \\ | This would enable levels WARN, ERROR and FATAL. \\ | ||
- | If you do not specify a certain level the default level is INFO. If you want to see all messages you have to use '' | + | If you do not specify a certain level the default level is INFO. If you want to see all messages you have to use '' |
===== Default LogWriter ===== | ===== Default LogWriter ===== | ||
Line 48: | Line 46: | ||
Sometimes it can be desirable to have a logger write to the console and write the same content into a file. This is especially helpful on a embedded system where you start an application remotely (e.g. through //ssh//). In such a case you can define a '' | Sometimes it can be desirable to have a logger write to the console and write the same content into a file. This is especially helpful on a embedded system where you start an application remotely (e.g. through //ssh//). In such a case you can define a '' | ||
<code cpp> | <code cpp> | ||
- | | + | |
</ | </ | ||
- | A lop file will be created at the given location. Its file name will be appended with the current date and time of the creation of the file. That is the creation of the '' | + | A log file will be created at the given location. Its file name will be appended with the current date and time of the creation of the file. |
tools/logger/start.txt · Last modified: 2020/11/26 13:06 by ursgraf