Peano
Loading...
Searching...
No Matches
ChromeTraceFileLogger.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#ifdef Parallel
6#include <mpi.h>
7#endif
8
9#include <iostream>
10#include <fstream>
11#include <set>
12#include <stack>
13
16#include "tarch/logging/Log.h"
17
18namespace tarch {
19 namespace logging {
21 }
22}
23
35 private:
36 static Log _log;
37
39
41
45 std::ostream* _outputStream;
48
49 void nextEntry();
50
56
62
66 std::string addSeparators(std::string message) const;
67
72 std::string constructMessageString(
73 std::string messageType,
74 long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message
75 );
76
78 std::string messageType,
79 long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message
80 );
81
86
91
92 public:
94
96
97 void debug( long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message);
98 void info( long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message);
99 void warning( long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message);
100 void error( long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message);
101 void traceIn( long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message);
102 void traceOut(long int timestampMS, int rank, int threadId, const std::string& trace, const std::string& message);
103
109 void indent( bool indent, const std::string& trace, const std::string& message );
110
116 void setOutputFile( const std::string& outputLogFileName );
117
118 void setQuitOnError(bool value);
119
120 void close();
121};
void debug(long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
std::string constructEventEntryInTraceFile(std::string messageType, long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
void indent(bool indent, const std::string &trace, const std::string &message)
Tells the logger to increment/decrement the indent.
void info(long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
std::ostream * _outputStream
Test for the column separator of a string output.
ChromeTraceFileLogger & operator=(const ChromeTraceFileLogger &)
Declared private since assignment does not make sense for an output class (output information mismatc...
void traceIn(long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
tarch::multicore::BooleanSemaphore _semaphore
static ChromeTraceFileLogger _singleton
void error(long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
void configureOutputStreams()
Configures the output streams.
void setOutputFile(const std::string &outputLogFileName)
Is redundant, as you could use setLogFormat() instead.
std::string addSeparators(std::string message) const
Ensures each column has same length.
void traceOut(long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
static ChromeTraceFileLogger & getInstance()
void warning(long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
std::string constructMessageString(std::string messageType, long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
Construct message string for output to terminal.
Log Device.
Definition Log.h:516
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19