salsa 0.7.1
Loading...
Searching...
No Matches
Salsa::Log Class Reference

More...

#include <Log.hh>

Public Member Functions

int add (std::string)
 Add output sink (file, console, zmq) for SPDLOG.
 
void name (char const *pNewName)
 Set name of job (only used for spdlog logger identification)
 
void name (std::string newName)
 Set name of job (only used for spdlog logger identification)
 
std::string name () const
 Get name of job (only used for spdlog logger identification)
 
int create ()
 Create SPDLOG loger.
 
int write (char const *)
 Write to logger.
 
std::shared_ptr< spdlog::logger > spd ()
 Get SPDLOG logger handle.
 
int empty ()
 Get info about sinks.
 
void fd (int newFD)
 Set FD of pipe to watch.
 
int fd () const
 Get FD of currently watched pipe.
 

Private Attributes

int mFD = -1
 FD of current pipe.
 
std::string mName = nullptr
 newName (name) of current job
 
std::vector< spdlog::sink_ptr > mSinks
 Sinks for SPDLOG.
 
std::shared_ptr< spdlog::logger > mpTarget = nullptr
 SPDLOG logger handle.
 

Static Private Attributes

static uint64_t msID = 0
 Static Job newName (holds index)
 

Detailed Description

Constructor & Destructor Documentation

◆ Log()

Salsa::Log::Log ( )

Definition at line 8 of file Log.cc.

◆ ~Log()

Salsa::Log::~Log ( )

Definition at line 10 of file Log.cc.

Member Function Documentation

◆ add()

int Salsa::Log::add ( std::string where)

Add output sink (file, console, zmq) for SPDLOG.

Definition at line 12 of file Log.cc.

Referenced by Salsa::ActorZmq::SalsaActorForkFn().

◆ create()

int Salsa::Log::create ( )

Create SPDLOG loger.

Definition at line 45 of file Log.cc.

Referenced by Salsa::ActorZmq::SalsaActorForkFn().

◆ empty()

int Salsa::Log::empty ( )
inline

Get info about sinks.

Definition at line 41 of file Log.hh.

References mSinks.

◆ fd() [1/2]

int Salsa::Log::fd ( ) const
inline

Get FD of currently watched pipe.

Definition at line 46 of file Log.hh.

References mFD.

◆ fd() [2/2]

void Salsa::Log::fd ( int newFD)
inline

Set FD of pipe to watch.

Definition at line 44 of file Log.hh.

References mFD.

Referenced by Salsa::ActorZmq::actorProcwaitSupport_(), and Salsa::ActorZmq::SalsaActorForkFn().

◆ name() [1/3]

std::string Salsa::Log::name ( ) const
inline

Get name of job (only used for spdlog logger identification)

Definition at line 32 of file Log.hh.

References mName.

◆ name() [2/3]

void Salsa::Log::name ( char const * pNewName)
inline

Set name of job (only used for spdlog logger identification)

Definition at line 27 of file Log.hh.

References mName.

◆ name() [3/3]

void Salsa::Log::name ( std::string newName)
inline

Set name of job (only used for spdlog logger identification)

Definition at line 29 of file Log.hh.

References mName.

◆ spd()

std::shared_ptr< spdlog::logger > Salsa::Log::spd ( )
inline

Get SPDLOG logger handle.

Definition at line 39 of file Log.hh.

References mpTarget.

Referenced by Salsa::ActorZmq::SalsaActorForkFn().

◆ write()

int Salsa::Log::write ( char const * pContent)

Write to logger.

Definition at line 64 of file Log.cc.

Referenced by Salsa::ActorZmq::actorProcwaitSupport_().

Member Data Documentation

◆ mFD

int Salsa::Log::mFD = -1
private

FD of current pipe.

Definition at line 49 of file Log.hh.

Referenced by fd(), and fd().

◆ mName

std::string Salsa::Log::mName = nullptr
private

newName (name) of current job

Definition at line 51 of file Log.hh.

Referenced by name(), name(), and name().

◆ mpTarget

std::shared_ptr<spdlog::logger> Salsa::Log::mpTarget = nullptr
private

SPDLOG logger handle.

Definition at line 53 of file Log.hh.

Referenced by spd().

◆ msID

uint64_t Salsa::Log::msID = 0
staticprivate

Static Job newName (holds index)

Definition at line 50 of file Log.hh.

◆ mSinks

std::vector<spdlog::sink_ptr> Salsa::Log::mSinks
private

Sinks for SPDLOG.

Definition at line 52 of file Log.hh.

Referenced by empty().


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