Belle II Software development
LogConnectionJSON.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/logging/LogConnectionConsole.h>
12
13namespace Belle2 {
27
28 public:
29
34 explicit LogConnectionJSON(bool complete = false);
35
37 ~LogConnectionJSON() override = default;
38
45 bool sendMessage(const LogMessage& message) override;
46
50 bool isConnected() override { return m_console.isConnected(); }
51
53 void finalizeOnAbort() override
54 {
56 }
57
58 private:
63 };
64
66} // end namespace Belle2
Abstract base class for the different types of log connections.
Implements a log connection to an IO Stream.
bool isConnected() override
Returns true if the connection to the io stream could be established.
void finalizeOnAbort() override
Make sure output is flushed on abort.
Implements a log connection to stdout but with messages formatted as json objects to allow easy parsi...
LogConnectionConsole m_console
LogConnection to the console we use to dispatch the json objects.
bool m_complete
If true ignore the log message format settings and output everything.
bool isConnected() override
Returns true if the connection to the text file could be established.
~LogConnectionJSON() override=default
The LogConnectionJSONFile destructor.
void finalizeOnAbort() override
Finalize on Abort: make sure that connected connection is finalized.
The LogMessage class.
Definition: LogMessage.h:29
bool sendMessage(const LogMessage &message) override
Sends a log message.
Abstract base class for different kinds of events.