Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Logger.h@9:951b6b0bfdf8, 2019-03-10 (annotated)
- Committer:
- loicguibert
- Date:
- Sun Mar 10 13:42:31 2019 +0000
- Revision:
- 9:951b6b0bfdf8
- Parent:
- 0:cbc40e6ff273
- Child:
- 12:856286ad4cdc
Logger improved, tp.02 done
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| loicguibert | 0:cbc40e6ff273 | 1 | #pragma once |
| loicguibert | 0:cbc40e6ff273 | 2 | |
| loicguibert | 0:cbc40e6ff273 | 3 | #include <mbed.h> |
| loicguibert | 9:951b6b0bfdf8 | 4 | #include <ctime> |
| loicguibert | 0:cbc40e6ff273 | 5 | |
| loicguibert | 0:cbc40e6ff273 | 6 | class Logger { |
| loicguibert | 0:cbc40e6ff273 | 7 | public: |
| loicguibert | 0:cbc40e6ff273 | 8 | // constructor |
| loicguibert | 0:cbc40e6ff273 | 9 | Logger(bool logTimestamp); |
| loicguibert | 0:cbc40e6ff273 | 10 | |
| loicguibert | 0:cbc40e6ff273 | 11 | // method called for printing a message, preprended with timestamp information if requested |
| loicguibert | 0:cbc40e6ff273 | 12 | void log(const char * format, ...); |
| loicguibert | 0:cbc40e6ff273 | 13 | |
| loicguibert | 0:cbc40e6ff273 | 14 | private: |
| loicguibert | 0:cbc40e6ff273 | 15 | bool m_logTimestamp; |
| loicguibert | 9:951b6b0bfdf8 | 16 | Timer m_timer; |
| loicguibert | 0:cbc40e6ff273 | 17 | }; |