HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_UniversalLogFileLikeSink.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_UniversalLogFileLikeSink.h
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __UT_UNIVERSALLOGFILELIKESINK_H__
13 #define __UT_UNIVERSALLOGFILELIKESINK_H__
14 
15 #include "UT_API.h"
16 #include "UT_Error.h"
17 #include "UT_Function.h"
18 #include "UT_Lock.h"
19 #include "UT_StringHolder.h"
20 #include "UT_UniversalLogSink.h"
21 
23 
25 {
26 public:
28  const UT_UniversalLogEntry&,
30 
33  : myMinSeverity(UT_ERROR_NONE)
34  {
35  }
36 
38  { myLogEntryFormatCallback = callback; }
39 
41  { myMinSeverity = severity; }
42  int minSeverity() const
43  { return myMinSeverity; }
44  static UT_StringHolder severityToString(UT_ErrorSeverity sev);
45 
46 protected:
47  void doLog(const UT_UniversalLogEntry& entry) override;
48 
49  virtual void formatLogEntry(const UT_UniversalLogEntry &entry,
50  UT_StringHolder &msg) const = 0;
52  const UT_StringHolder &msg) const = 0;
53 
54 private:
55  UT_Lock myOutputLock;
56  UT_ErrorSeverity myMinSeverity;
57  LogEntryFormatCallback myLogEntryFormatCallback;
58 };
59 
60 #endif // __UT_UNIVERSALLOGFILELIKESINK_H__
61 
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
void setMinSeverity(UT_ErrorSeverity severity)
void setFormatEntryCallback(const LogEntryFormatCallback &callback)
void
Definition: png.h:1083
UT_ErrorSeverity
Definition: UT_Error.h:25
#define UT_API
Definition: UT_API.h:14
UT_Function< void(const UT_UniversalLogEntry &, UT_StringHolder &message)> LogEntryFormatCallback
void writeString(std::ostream &os, const Name &name)
Definition: Name.h:33
GLenum GLenum severity
Definition: glcorearb.h:2539
std::function< T > UT_Function
Definition: UT_Function.h:37
virtual void doLog(const UT_UniversalLogEntry &entry)=0
Simple object to hold the data associated with a single log entry event.