HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UT_UniversalLogConsoleSink.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_UniversalLogConsoleSink.h
7
*
8
* COMMENTS:
9
*
10
*/
11
12
#ifndef __UT_UNIVERSALLOGCONSOLESINK_H__
13
#define __UT_UNIVERSALLOGCONSOLESINK_H__
14
15
#include "
UT_API.h
"
16
#include "
UT_Error.h
"
17
#include "
UT_StringArray.h
"
18
#include "
UT_StringHolder.h
"
19
#include "
UT_UniversalLogFileLikeSink.h
"
20
21
class
UT_UniversalLogEntry
;
22
23
class
UT_API
UT_UniversalLogConsoleSink
:
public
UT_UniversalLogFileLikeSink
24
{
25
public
:
26
enum
OutFlags
27
{
28
kNONE = 0x0,
29
kFILE = 0x1,
30
kLINE = 0x2,
31
kFILELINE = kFILE | kLINE,
32
kTHREAD = 0x4,
33
kDATE = 0x8
34
};
35
36
UT_UniversalLogConsoleSink
(
const
UT_UniversalLogConsoleSink
&) =
delete
;
37
UT_UniversalLogConsoleSink
()
38
: myEnableColor(false)
39
, myOutputFlags(
OutFlags
::kNONE)
40
{
41
init();
42
}
43
UT_UniversalLogConsoleSink
(
44
const
UT_StringArray
& whitelist,
45
const
UT_StringArray
& blacklist)
46
: myEnableColor(false)
47
, myOutputFlags(
OutFlags
::kNONE)
48
{
49
init();
50
}
51
~UT_UniversalLogConsoleSink
()
override
52
{
53
// We may get doLog calls until we are disconnected, so we must
54
// disconnect before doing any real destruction of this object.
55
disconnectAll
();
56
}
57
58
void
setEnableColor
(
bool
enable)
59
{ myEnableColor = enable; }
60
bool
enableColor
()
const
61
{
return
myEnableColor; }
62
63
protected
:
64
void
formatLogEntry
(
const
UT_UniversalLogEntry
&entry,
65
UT_StringHolder
&msg)
const override
;
66
void
writeString
(
UT_ErrorSeverity
severity
,
67
const
UT_StringHolder
&msg)
const override
;
68
69
private
:
70
void
init();
71
static
void
printToConsole(
72
int
error_level,
73
const
char
* msg,
74
bool
enable_color);
75
76
int
myOutputFlags;
77
bool
myEnableColor;
78
};
79
80
#endif // __UT_UNIVERSALLOGCONSOLESINK_H__
81
UT_UniversalLogConsoleSink
Definition:
UT_UniversalLogConsoleSink.h:23
UT_UniversalLogConsoleSink::UT_UniversalLogConsoleSink
UT_UniversalLogConsoleSink()
Definition:
UT_UniversalLogConsoleSink.h:37
UT_StringArray.h
UT_API.h
UT_ErrorSeverity
UT_ErrorSeverity
Definition:
UT_Error.h:25
UT_API
#define UT_API
Definition:
UT_API.h:14
UT_UniversalLogConsoleSink::UT_UniversalLogConsoleSink
UT_UniversalLogConsoleSink(const UT_StringArray &whitelist, const UT_StringArray &blacklist)
Definition:
UT_UniversalLogConsoleSink.h:43
UT_StringHolder
Definition:
UT_StringHolder.h:999
UT_StringArray
Definition:
UT_StringArray.h:24
UT_UniversalLogFileLikeSink::formatLogEntry
virtual void formatLogEntry(const UT_UniversalLogEntry &entry, UT_StringHolder &msg) const =0
severity
GLenum GLenum severity
Definition:
glcorearb.h:2539
UT_UniversalLogFileLikeSink::writeString
virtual void writeString(UT_ErrorSeverity severity, const UT_StringHolder &msg) const =0
UT_UniversalLogFileLikeSink.h
UT_StringHolder.h
UT_UniversalLogConsoleSink::~UT_UniversalLogConsoleSink
~UT_UniversalLogConsoleSink() override
Definition:
UT_UniversalLogConsoleSink.h:51
UT_UniversalLogConsoleSink::enableColor
bool enableColor() const
Definition:
UT_UniversalLogConsoleSink.h:60
UT_UniversalLogConsoleSink::OutFlags
OutFlags
Definition:
UT_UniversalLogConsoleSink.h:26
UT_UniversalLogEntry
Simple object to hold the data associated with a single log entry event.
Definition:
UT_UniversalLogEntry.h:58
UT_UniversalLogConsoleSink::setEnableColor
void setEnableColor(bool enable)
Definition:
UT_UniversalLogConsoleSink.h:58
UT_Error.h
UT_UniversalLogSink::disconnectAll
void disconnectAll()
UT_UniversalLogFileLikeSink
Definition:
UT_UniversalLogFileLikeSink.h:24
UT
UT_UniversalLogConsoleSink.h
Generated on Tue Dec 17 2024 03:42:24 for HDK by
1.8.6