 |
Belle II Software
release-05-02-19
|
13 #include <framework/logging/LogConnectionBase.h>
26 class LogConnectionConsole final:
public LogConnectionBase {
49 bool sendMessage(
const LogMessage& message)
override;
52 void write(
const std::string& message);
static bool terminalSupportsColors(int fileDescriptor)
Returns true if the given file descriptor is a tty and supports colors.
void finalizeOnAbort() override
Make sure output is flushed on abort.
int m_fd
The output stream used for sending the log message.
static bool getEscapeNewlinesEnabled()
Check whether we want to escape newlines on console.
LogConnectionConsole(int outputFD, bool color)
Constructor.
~LogConnectionConsole() override
Destructor.
bool sendMessage(const LogMessage &message) override
Sends a log message.
bool isConnected() override
Returns true if the connection to the io stream could be established.
Abstract base class for different kinds of events.
static bool s_escapeNewlinesEnabled
Flag to indicate whether newlines should be replaced by ' ' in the output.
static void setEscapeNewlinesEnabled(bool enabled)
Set whether we want to escape newlines on console.
void write(const std::string &message)
Send a preformatted string message to the connected output.
static void setPythonLoggingEnabled(bool enabled)
Set whether console logging via pyhthon is enabled.
static bool getPythonLoggingEnabled()
Check whether console logging via python is enabled.
static bool s_pythonLoggingEnabled
Flag to indicate whether log messages should be sent to python sys.stdout.
bool m_color
Flag for color output.