Public Member Functions | Private Attributes | Static Private Attributes | List of all members
FIX::ScreenLog Class Reference

Screen based implementation of Log. More...

#include <Log.h>

Inheritance diagram for FIX::ScreenLog:
Inheritance graph
[legend]
Collaboration diagram for FIX::ScreenLog:
Collaboration graph
[legend]

Public Member Functions

 ScreenLog (bool incoming, bool outgoing, bool event)
 
 ScreenLog (const SessionID &sessionID, bool incoming, bool outgoing, bool event)
 
void clear ()
 
void backup ()
 
void onIncoming (const std::string &value)
 
void onOutgoing (const std::string &value)
 
void onEvent (const std::string &value)
 
- Public Member Functions inherited from FIX::Log
virtual ~Log ()
 

Private Attributes

std::string m_prefix
 
UtcTimeStamp m_time
 
bool m_incoming
 
bool m_outgoing
 
bool m_event
 

Static Private Attributes

static Mutex s_mutex
 

Detailed Description

Screen based implementation of Log.

This will display all log information onto the standard output

Definition at line 115 of file Log.h.

Constructor & Destructor Documentation

◆ ScreenLog() [1/2]

FIX::ScreenLog::ScreenLog ( bool  incoming,
bool  outgoing,
bool  event 
)
inline

Definition at line 118 of file Log.h.

119: m_prefix( "GLOBAL" ),
120 m_incoming( incoming ), m_outgoing( outgoing ), m_event( event ) {}
bool m_event
Definition Log.h:168
bool m_incoming
Definition Log.h:166
std::string m_prefix
Definition Log.h:164
bool m_outgoing
Definition Log.h:167

◆ ScreenLog() [2/2]

FIX::ScreenLog::ScreenLog ( const SessionID sessionID,
bool  incoming,
bool  outgoing,
bool  event 
)
inline

Definition at line 122 of file Log.h.

124: m_prefix( sessionID.toString() ),
125 m_incoming( incoming ), m_outgoing( outgoing ), m_event( event ) {}

Member Function Documentation

◆ backup()

void FIX::ScreenLog::backup ( )
inlinevirtual

Implements FIX::Log.

Definition at line 128 of file Log.h.

128{}

◆ clear()

void FIX::ScreenLog::clear ( )
inlinevirtual

Implements FIX::Log.

Definition at line 127 of file Log.h.

127{}

◆ onEvent()

void FIX::ScreenLog::onEvent ( const std::string &  value)
inlinevirtual

Implements FIX::Log.

Definition at line 152 of file Log.h.

153 {
154 if ( !m_event ) return ;
155 Locker l( s_mutex );
157 std::cout << "<" << UtcTimeStampConvertor::convert(m_time, 9)
158 << ", " << m_prefix
159 << ", " << "event>" << std::endl
160 << " (" << value << ")" << std::endl;
161 }
static Mutex s_mutex
Definition Log.h:169
UtcTimeStamp m_time
Definition Log.h:165
static std::string convert(const UtcTimeStamp &value, int precision=0)

References FIX::UtcTimeStampConvertor::convert(), m_event, m_prefix, m_time, s_mutex, and FIX::UtcTimeStamp::setCurrent().

◆ onIncoming()

void FIX::ScreenLog::onIncoming ( const std::string &  value)
inlinevirtual

Implements FIX::Log.

Definition at line 130 of file Log.h.

131 {
132 if ( !m_incoming ) return ;
133 Locker l( s_mutex );
135 std::cout << "<" << UtcTimeStampConvertor::convert(m_time, 9)
136 << ", " << m_prefix
137 << ", " << "incoming>" << std::endl
138 << " (" << value << ")" << std::endl;
139 }

References FIX::UtcTimeStampConvertor::convert(), m_incoming, m_prefix, m_time, s_mutex, and FIX::UtcTimeStamp::setCurrent().

◆ onOutgoing()

void FIX::ScreenLog::onOutgoing ( const std::string &  value)
inlinevirtual

Implements FIX::Log.

Definition at line 141 of file Log.h.

142 {
143 if ( !m_outgoing ) return ;
144 Locker l( s_mutex );
146 std::cout << "<" << UtcTimeStampConvertor::convert(m_time, 9)
147 << ", " << m_prefix
148 << ", " << "outgoing>" << std::endl
149 << " (" << value << ")" << std::endl;
150 }

References FIX::UtcTimeStampConvertor::convert(), m_outgoing, m_prefix, m_time, s_mutex, and FIX::UtcTimeStamp::setCurrent().

Member Data Documentation

◆ m_event

bool FIX::ScreenLog::m_event
private

Definition at line 168 of file Log.h.

Referenced by onEvent().

◆ m_incoming

bool FIX::ScreenLog::m_incoming
private

Definition at line 166 of file Log.h.

Referenced by onIncoming().

◆ m_outgoing

bool FIX::ScreenLog::m_outgoing
private

Definition at line 167 of file Log.h.

Referenced by onOutgoing().

◆ m_prefix

std::string FIX::ScreenLog::m_prefix
private

Definition at line 164 of file Log.h.

Referenced by onEvent(), onIncoming(), and onOutgoing().

◆ m_time

UtcTimeStamp FIX::ScreenLog::m_time
private

Definition at line 165 of file Log.h.

Referenced by onEvent(), onIncoming(), and onOutgoing().

◆ s_mutex

Mutex FIX::ScreenLog::s_mutex
staticprivate

Definition at line 169 of file Log.h.

Referenced by onEvent(), onIncoming(), and onOutgoing().


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

Generated on Thu Feb 29 2024 22:38:19 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001