|
MoorDyn
|
A Logging utility. More...
#include <Log.hpp>
Public Member Functions | |
| Log (const int verbosity=MOORDYN_MSG_LEVEL, const int log_file_level=MOORDYN_DBG_LEVEL) | |
| Constructor. More... | |
| ~Log () | |
| Destructor. | |
| MultiStream & | Cout (const int level=MOORDYN_MSG_LEVEL) const |
| Get a stream to log data. More... | |
| int | GetVerbosity () const |
| Get the verbosity level. More... | |
| void | SetVerbosity (const int verbosity) |
| Set the verbosity level. More... | |
| int | GetLogLevel () const |
| Get the log file printing level. More... | |
| void | SetLogLevel (const int level) |
| Set the log file printing level. More... | |
| const char * | GetFile () const |
| Get the log file path. More... | |
| void | SetFile (const char *file_path) |
| Set the log file path. More... | |
A Logging utility.
This class is a sensible replacement for std::cout and std::cerr ofstream entities, providing the appropriate streaming channel to each entity
| moordyn::Log::Log | ( | const int | verbosity = MOORDYN_MSG_LEVEL, |
| const int | log_file_level = MOORDYN_DBG_LEVEL |
||
| ) |
Constructor.
| verbosity | The verbosity level (see Moordyn_log) |
| log_file_level | The same than verbosity, but for the log file (if any is open with SetFile(). It is disabled by default) |
| moordyn::mem_error | If the inner streamer cannot be built |
| MultiStream & moordyn::Log::Cout | ( | const int | level = MOORDYN_MSG_LEVEL | ) | const |
Get a stream to log data.
Whether the message is logged, and where, depends on the verbosity level
| level | Message level |


| const char * moordyn::Log::GetFile | ( | ) | const |
Get the log file path.

|
inline |
Get the log file printing level.
|
inline |
Get the verbosity level.
| void moordyn::Log::SetFile | ( | const char * | file_path | ) |
Set the log file path.
This method will immediately try to open such file for writing.
| file_path | The log file path |
| moordyn::output_file_error | If the output file cannot be opened/created at file_path |

|
inline |
Set the log file printing level.
| level | The log file printing level (see Moordyn_log) |
|
inline |
Set the verbosity level.
| verbosity | The verbosity level (see Moordyn_log) |