Belle II Software light-2406-ragdoll
LogConnectionJSON Class Referencefinal

Implements a log connection to stdout but with messages formatted as json objects to allow easy parsing by other tools, say jupyter notebooks. More...

#include <LogConnectionJSON.h>

Inheritance diagram for LogConnectionJSON:
Collaboration diagram for LogConnectionJSON:

Public Member Functions

 LogConnectionJSON (bool complete=false)
 The constructor.
 
 ~LogConnectionJSON () override=default
 The LogConnectionJSONFile destructor.
 
bool sendMessage (const LogMessage &message) override
 Sends a log message.
 
bool isConnected () override
 Returns true if the connection to the text file could be established.
 
void finalizeOnAbort () override
 Finalize on Abort: make sure that connected connection is finalized.
 

Private Attributes

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.
 

Detailed Description

Implements a log connection to stdout but with messages formatted as json objects to allow easy parsing by other tools, say jupyter notebooks.

Inherits from the abstract base class LogConnectionBase and uses LogConnectionConsole to do the actual output

Definition at line 26 of file LogConnectionJSON.h.

Member Function Documentation

◆ finalizeOnAbort()

void finalizeOnAbort ( )
inlineoverridevirtual

Finalize on Abort: make sure that connected connection is finalized.

Reimplemented from LogConnectionBase.

Definition at line 53 of file LogConnectionJSON.h.

54 {
56 }
void finalizeOnAbort() override
Make sure output is flushed on abort.
LogConnectionConsole m_console
LogConnection to the console we use to dispatch the json objects.

◆ isConnected()

bool isConnected ( )
inlineoverridevirtual

Returns true if the connection to the text file could be established.

Implements LogConnectionBase.

Definition at line 50 of file LogConnectionJSON.h.

50{ return m_console.isConnected(); }
bool isConnected() override
Returns true if the connection to the io stream could be established.

Member Data Documentation

◆ m_complete

bool m_complete
private

If true ignore the log message format settings and output everything.

Definition at line 62 of file LogConnectionJSON.h.

◆ m_console

LogConnectionConsole m_console
private

LogConnection to the console we use to dispatch the json objects.

Definition at line 60 of file LogConnectionJSON.h.


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