Virtru SDK for C++  2.8.0
Virtru C++ SDK library - Create, Read, and Manage TDF3 Files
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tdf_logging_interface.h
Go to the documentation of this file.
1 /*
2 * Copyright 2019 Virtru Corporation
3 *
4 * SPDX - License Identifier: BSD-3-Clause-Clear
5 *
6 */
7 //
8 // TDF SDK
9 //
10 // Created by Sujan Reddy on 2019/03/14.
11 //
12 
13 #ifndef VIRTRU_LOGGING_INTERFACE_H
14 #define VIRTRU_LOGGING_INTERFACE_H
15 
16 #include "tdf_constants.h"
17 
18 #include <string>
19 #include <ctime>
20 
21 namespace virtru {
22 
24  struct LogMessage {
26  std::string message;
27  std::string fileName;
28  std::string function;
29  unsigned int line;
30  std::time_t timestamp; // time since epoch in milliseconds
31  };
32 
38  class ILogger {
39  public:
40  virtual ~ILogger() = default;
41 
44  virtual void TDFSDKLog(LogMessage logMessage) = 0;
45  };
46 } // namespace virtru
47 
48 #endif // VIRTRU_LOGGING_INTERFACE_H
unsigned int line
Definition: tdf_logging_interface.h:29
std::time_t timestamp
Definition: tdf_logging_interface.h:30
LogLevel
Defines a log level.
Definition: tdf_constants.h:52
std::string fileName
Definition: tdf_logging_interface.h:27
virtual void TDFSDKLog(LogMessage logMessage)=0
Definition: tdf_logging_interface.h:38
Log message data.
Definition: tdf_logging_interface.h:24
virtual ~ILogger()=default
LogLevel level
Definition: tdf_logging_interface.h:25
std::string message
Definition: tdf_logging_interface.h:26