Peano
Loading...
Searching...
No Matches
ITACLogger.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#include <map>
14#include <string>
15
18#include "tarch/logging/Log.h"
19
20namespace tarch {
21 namespace logging {
22 class ITACLogger;
23 }
24}
25
52 private:
53 static Log _log;
54
56
58
59 std::map< std::string, int > _itacHandles;
60
62
68
73 ITACLogger(const ITACLogger&) = delete;
74
91 std::string messageType,
92 long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message
93 );
94
103
104 std::string getTimeStampHumanReadable( long int timestampNanoseconds ) const;
105
106 public:
108
110
115 bool getLogMachineName() const;
116
121 bool getLogThreadName() const;
122
127 bool getLogTrace() const;
128
133 bool getLogTimeStamp() const;
134
135 void debug( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
136 void info( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
137
147 void warning( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
148
158 void error( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
159
160 void traceIn( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
161 void traceOut( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
162
170 void indent( bool indent, const std::string& trace ) {};
171
172 void close();
173
176};
Command Line Logger.
Definition ITACLogger.h:51
static ITACLogger & getInstance()
void info(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
bool getLogThreadName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
static ITACLogger _singleton
Definition ITACLogger.h:55
void traceIn(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
std::map< std::string, int > _itacHandles
Definition ITACLogger.h:59
std::string getTimeStampHumanReadable(long int timestampNanoseconds) const
ITACLogger(const ITACLogger &)=delete
Declared private since copying does not make sense for an output class (output information mismatch).
void traceOut(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
bool getLogMachineName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
tarch::multicore::MultiReadSingleWriteSemaphore _semaphore
Definition ITACLogger.h:57
void error(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Error.
void warning(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Warning.
void indent(bool indent, const std::string &trace)
Tells the logger to increment/decrement the indent.
Definition ITACLogger.h:170
std::string constructMessageString(std::string messageType, long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Construct message string.
bool getLogTimeStamp() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void debug(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
ITACLogger()
It's a singleton.
bool getLogTrace() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
ITACLogger & operator=(const CommandLineLogger &)=delete
Declared private since assignment does not make sense for an output class (output information mismatc...
Log Device.
Definition Log.h:517
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19