Log.cpp
Go to the documentation of this file.
1/****************************************************************************
2** Copyright (c) 2001-2014
3**
4** This file is part of the QuickFIX FIX Engine
5**
6** This file may be distributed under the terms of the quickfixengine.org
7** license as defined by quickfixengine.org and appearing in the file
8** LICENSE included in the packaging of this file.
9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12**
13** See http://www.quickfixengine.org/LICENSE for licensing information.
14**
15** Contact ask@quickfixengine.org if any conditions of this licensing are
16** not clear to you.
17**
18****************************************************************************/
19
20#ifdef _MSC_VER
21#include "stdafx.h"
22#else
23#include "config.h"
24#endif
25
26#include "Log.h"
27
28namespace FIX
29{
31
33{
34 bool incoming, outgoing, event;
35 init( m_settings.get(), incoming, outgoing, event );
36 return new ScreenLog( incoming, outgoing, event );
37}
38
40{
41 Dictionary settings;
42 if( m_settings.has(sessionID) )
43 settings = m_settings.get( sessionID );
44
45 bool incoming, outgoing, event;
46 init( settings, incoming, outgoing, event );
47 return new ScreenLog( sessionID, incoming, outgoing, event );
48}
49
50void ScreenLogFactory::init( const Dictionary& settings, bool& incoming, bool& outgoing, bool& event )
51{
52 if( m_useSettings )
53 {
54 incoming = true;
55 outgoing = true;
56 event = true;
57
58 if( settings.has(SCREEN_LOG_SHOW_INCOMING) )
59 incoming = settings.getBool(SCREEN_LOG_SHOW_INCOMING);
60 if( settings.has(SCREEN_LOG_SHOW_OUTGOING) )
61 outgoing = settings.getBool(SCREEN_LOG_SHOW_OUTGOING);
62 if( settings.has(SCREEN_LOG_SHOW_EVENTS) )
63 event = settings.getBool(SCREEN_LOG_SHOW_EVENTS);
64 }
65 else
66 {
67 incoming = m_incoming;
68 outgoing = m_outgoing;
69 event = m_event;
70 }
71}
72
74{
75 delete pLog;
76}
77} //namespace FIX
For storage and retrieval of key/value pairs.
Definition Dictionary.h:37
bool getBool(const std::string &) const
Get a value as a bool.
bool has(const std::string &) const
Check if the dictionary contains a value for key.
This interface must be implemented to log messages and events.
Definition Log.h:82
void init(const Dictionary &settings, bool &incoming, bool &outgoing, bool &event)
Definition Log.cpp:50
SessionSettings m_settings
Definition Log.h:75
void destroy(Log *log)
Definition Log.cpp:73
Screen based implementation of Log.
Definition Log.h:116
static Mutex s_mutex
Definition Log.h:169
Unique session id consists of BeginString, SenderCompID and TargetCompID.
Definition SessionID.h:31
const bool has(const SessionID &) const
Check if session setings are present.
const Dictionary & get(const SessionID &) const
Get a dictionary for a session.
const char SCREEN_LOG_SHOW_EVENTS[]
const char SCREEN_LOG_SHOW_OUTGOING[]
const char SCREEN_LOG_SHOW_INCOMING[]

Generated on Mon Mar 4 2024 21:10:02 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001