|
| Log (std::string const &module) |
| The Log constructor. More...
|
|
void | fatal (std::string const &fatal, std::string const &file, int line) |
|
void | err (std::string const &err, std::string const &file, int line) |
|
void | warn (std::string const &warn, std::string const &file, int line) |
|
void | debug (std::string const &debug, std::string const &file, int line) |
|
void | info (std::string const &info, std::string const &file, int line) |
|
You don't need to instantiate a log object to use the system, you can if you want to, but it is recommended that you use the macro system instead.
To just get a log line out:
...
FSYS::Log::info("This is an info message");
...
The above will output something like:
Info: "This is an info message"
How ever, it is recomended to use the macro interface:
DECLARE_LOG_MODULE("MyModuleName");
...
INFO("This is an info message");
...
As this will also output the modulename, filename, and line number:
Info: (MyModuleName)"This is an info message"@filepath(line number)
Other macros are:
- FATAL(msg) - For fatal, non-recoverable errors (leads to program crash/closure)
- ERR(msg) - For error messages, that are handled in one way or the other
- WARN(msg) - For warnings/unexpected behavior
- DEBUG(msg) - For debug messages, used during development
- INFO(msg) - For info/convinient messages usefull for knowing the state of the program
- Note
- It is not possible to have multiple calls to DECLARE_LOG_MODULE in the same source file.
FSYS::Log::Log |
( |
std::string const & |
module | ) |
|
The Log constructor takes a module name in, the form of a string, as argument, this string will be appended to all of the non-static log strings in the interface.
The same module name can be used across multiple source files, and it is possible to have multiple log objects/module names in the same source file (as long as you don't use the macros).
You don't need to instantiate the class if you only use the static functions in it.
- Parameters
-