Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Public Member Functions | List of all members
ska::cheetah::psrdada::detail::MultiLog Class Reference

A class for wrapping multilog_t instances required for logging with the underlying DADA API. More...

#include <cheetah/psrdada/detail/MultiLog.h>

Collaboration diagram for ska::cheetah::psrdada::detail::MultiLog:
Collaboration graph

Public Member Functions

 MultiLog (std::string name)
 Create a new instance. More...
 
 MultiLog (MultiLog const &)=delete
 
multilog_t * native_handle ()
 Get a native handle to the wrapped multilog_t pointer.
 
template<class... Args>
void write (int priority, const char *format, Args &&... args)
 Write to the log. More...
 
std::string const & name () const
 Return the name of the logger.
 

Detailed Description

A class for wrapping multilog_t instances required for logging with the underlying DADA API.

Definition at line 40 of file MultiLog.h.

Constructor & Destructor Documentation

◆ MultiLog()

ska::cheetah::psrdada::detail::MultiLog::MultiLog ( std::string  name)
explicit

Create a new instance.

Parameters
[in]nameThe name to give this logger

Definition at line 32 of file MultiLog.cpp.

33  : _name(name)
34  , _log(0)
35  , _open(false)
36 {
37  open();
38 }
std::string const & name() const
Return the name of the logger.
Definition: MultiLog.cpp:62

Member Function Documentation

◆ write()

template<class... Args>
void ska::cheetah::psrdada::detail::MultiLog::write ( int  priority,
const char *  format,
Args &&...  args 
)

Write to the log.

Parameters
[in]priorityThe priority (0, 1, 2...)
[in]formatThe format string
[in]...Parameters for the format string
Template Parameters
ArgsThe types of the parameters for the format string

Definition at line 34 of file MultiLog.cpp.

35 {
36  if (!_open)
37  {
38  throw panda::Error("MultiLog must be opened before writing");
39  }
40  multilog(_log, priority, format, std::forward<Args>(args)...);
41 }

The documentation for this class was generated from the following files: