ArcGIS Procedural Runtime  3.2.10650
LogHandler.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRT_LOGHANDLER_H_
19 #define PRT_LOGHANDLER_H_
20 
21 #include "prt/prt.h"
22 #include "prt/Object.h"
23 #include "prt/LogLevel.h"
24 #include "prt/Status.h"
25 
26 
27 namespace prt {
28 
29 
36 class PRT_EXPORTS_API LogHandler {
37 public:
38  static const size_t ALL_COUNT = 6;
39  static const prt::LogLevel ALL[ALL_COUNT];
40 
44  virtual void handleLogEvent(const wchar_t* msg, LogLevel level) = 0;
45 
51  virtual const LogLevel* getLevels(size_t* count) = 0;
52 
58  virtual void getFormat(bool* dateTime, bool* level) = 0;
59 
60 protected:
61  LogHandler();
62  virtual ~LogHandler();
63 };
64 
65 
72 class PRT_EXPORTS_API ConsoleLogHandler : public LogHandler, public Object {
73 public:
81  static ConsoleLogHandler* create(const LogLevel* levels, size_t count);
82 
83 protected:
85  virtual ~ConsoleLogHandler();
86 };
87 
88 
95 class PRT_EXPORTS_API FileLogHandler : public LogHandler, public Object {
96 public:
97 
107  static FileLogHandler* create(const LogLevel* levels, size_t count, const wchar_t* path);
108  virtual const wchar_t* getPath() const = 0;
109 
110 protected:
111  FileLogHandler();
112  virtual ~FileLogHandler();
113 };
114 
115 
116 } /* namespace prt */
117 
118 
119 #endif /* PRT_LOGHANDLER_H_ */
LogLevel
Definition: LogLevel.h:29
Definition: LogHandler.h:36
Definition: LogHandler.h:72
Definition: Object.h:35
Definition: LogHandler.h:95
The Procedural Runtime API namespace. The prt namespace contains the top level entry points into the ...
Definition: Annotation.h:24