Keeps track of logging output to screen and/or files.
More...
#include <casadi_logger.hpp>
All printout from CasADi routines should go through this files.
- Author
- Joel Andersson
- Date
- 2015
Extra doc: https://github.com/casadi/casadi/wiki/L_23u
Definition at line 44 of file casadi_logger.hpp.
|
static void | WriteFunThreadSafe (const char *s, std::streamsize num, bool error) |
|
static void | FlushThreadSafe (bool error) |
|
static void | writeDefault (const char *s, std::streamsize num, bool error) |
| By default, print to std::cout or std::cerr. More...
|
|
static void | flushDefault (bool error) |
| By default, flush std::cout or std::cerr. More...
|
|
static void | writeIgnore (const char *s, std::streamsize num, bool error) |
| Ignore output. More...
|
|
template<bool Err> |
static void | write (const char *s, std::streamsize num) |
| Print output message. More...
|
|
template<bool Err> |
static void | writeCh (char ch) |
| Print log message, single character. More...
|
|
◆ flushDefault()
static void casadi::Logger::flushDefault |
( |
bool |
error | ) |
|
|
inlinestatic |
Definition at line 69 of file casadi_logger.hpp.
71 std::cerr << std::flush;
73 std::cout << std::flush;
◆ FlushThreadSafe()
void casadi::Logger::FlushThreadSafe |
( |
bool |
error | ) |
|
|
static |
Definition at line 49 of file casadi_logger.cpp.
50 #ifdef CASADI_WITH_THREAD
51 std::lock_guard<std::mutex> lock(mutex_logger);
static void(* flush)(bool error)
Flush buffers.
References flush.
◆ write()
template<bool Err>
static void casadi::Logger::write |
( |
const char * |
s, |
|
|
std::streamsize |
num |
|
) |
| |
|
inlinestatic |
Definition at line 82 of file casadi_logger.hpp.
static void WriteFunThreadSafe(const char *s, std::streamsize num, bool error)
◆ writeCh()
template<bool Err>
static void casadi::Logger::writeCh |
( |
char |
ch | ) |
|
|
inlinestatic |
◆ writeDefault()
static void casadi::Logger::writeDefault |
( |
const char * |
s, |
|
|
std::streamsize |
num, |
|
|
bool |
error |
|
) |
| |
|
inlinestatic |
Definition at line 60 of file casadi_logger.hpp.
62 std::cerr.write(s, num);
64 std::cout.write(s, num);
◆ WriteFunThreadSafe()
void casadi::Logger::WriteFunThreadSafe |
( |
const char * |
s, |
|
|
std::streamsize |
num, |
|
|
bool |
error |
|
) |
| |
|
static |
Definition at line 42 of file casadi_logger.cpp.
43 #ifdef CASADI_WITH_THREAD
44 std::lock_guard<std::mutex> lock(mutex_logger);
static void(* writeFun)(const char *s, std::streamsize num, bool error)
Print warnings, can be redefined.
References writeFun.
◆ writeIgnore()
static void casadi::Logger::writeIgnore |
( |
const char * |
s, |
|
|
std::streamsize |
num, |
|
|
bool |
error |
|
) |
| |
|
inlinestatic |
◆ flush
◆ writeFun
void(* casadi::Logger::writeFun)(const char *s, std::streamsize num, bool error) |
|
static |
Initial value:=
static void writeDefault(const char *s, std::streamsize num, bool error)
By default, print to std::cout or std::cerr.
Definition at line 51 of file casadi_logger.hpp.
Referenced by WriteFunThreadSafe().
The documentation for this class was generated from the following files: