Swarm-NG
1.1
|
Manage CPU/GPU logs and writing them to appropriate output. More...
#include <logmanager.hpp>
Public Member Functions | |
void | init (const config &, int host_buffer_size=default_buffer_size, int device_buffer_size=default_buffer_size) |
Initialize logging system. More... | |
void | flush (int flags=memory) |
Stream the log from host_log and device_log to the output. More... | |
void | shutdown () |
Unitialize logging system. More... | |
Static Public Member Functions | |
static shared_ptr< manager > & | default_log () |
Default log that is initialized in swarm::init(cfg) It is automatically used in integrator. More... | |
Manage CPU/GPU logs and writing them to appropriate output.
Routines to coordinate three objects:
Purpose:
There is a default instance of this class that is initialized in swarm::init. For the most part you do not need to instantiate this class as long as you only need one log stream for your application. After initializing the swarm package using swarm::init, you can get the dafult log manager by calling log::manager::default_log() This is a good replacement for global hlog and dlog variables that were used in old swarm.
Definition at line 57 of file logmanager.hpp.
|
static |
Default log that is initialized in swarm::init(cfg) It is automatically used in integrator.
define default log manager and initialize it.
Definition at line 37 of file logmanager.cpp.
Referenced by swarm::init(), swarm::integrator::integrator(), swarm::gpu::integrator::integrator(), and main().
void swarm::log::manager::flush | ( | int | flags = memory ) |
Stream the log from host_log and device_log to the output.
Flush the output buffer for both host and device.
Definition at line 67 of file logmanager.cpp.
References gpulog::LOG_DEVCLEAR.
void swarm::log::manager::init | ( | const config & | cfg, |
int | host_buffer_size = default_buffer_size , |
||
int | device_buffer_size = default_buffer_size |
||
) |
Initialize logging system.
Initialize the log writer.
Definition at line 50 of file logmanager.cpp.
References swarm::log::writer::create().
Referenced by shutdown().
void swarm::log::manager::shutdown | ( | ) |
Unitialize logging system.
Reset the log manager.
Definition at line 59 of file logmanager.cpp.
References init().