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_UniversalLogFileSink.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_UniversalLogFileSink.h
7
*
8
* COMMENTS:
9
*
10
*/
11
12
#ifndef __UT_UNIVERSALLOGFILESINK_H__
13
#define __UT_UNIVERSALLOGFILESINK_H__
14
15
#include "
UT_API.h
"
16
#include "
UT_Error.h
"
17
#include "
UT_StringHolder.h
"
18
#include "
UT_UniversalLogFileLikeSink.h
"
19
20
class
UT_UniversalLogEntry
;
21
22
class
UT_API
UT_UniversalLogFileSink
:
public
UT_UniversalLogFileLikeSink
23
{
24
public
:
25
UT_UniversalLogFileSink
(
const
UT_UniversalLogFileSink
&) =
delete
;
26
UT_UniversalLogFileSink
(
const
UT_StringHolder
& filepath)
27
: myFilePath(filepath)
28
{
29
}
30
~UT_UniversalLogFileSink
()
override
31
{
32
// We may get doLog calls until we are disconnected, so we must
33
// disconnect before doing any real destruction of this object.
34
disconnectAll
();
35
}
36
37
const
UT_StringHolder
&
filePath
()
const
38
{
return
myFilePath; }
39
40
void
setMaxFileSize
(
exint
max_size) { myMaxFileSize = max_size; }
41
exint
maxFileSize
()
const
{
return
myMaxFileSize; }
42
43
void
setAppendDate
(
bool
adate) { myAppendDate = adate; }
44
bool
appendDate
()
const
{
return
myAppendDate; }
45
46
void
setPermissions
(
unsigned
int
perms) { myPermissions = perms; }
47
unsigned
int
permissions
()
const
{
return
myPermissions; }
48
49
protected
:
50
void
formatLogEntry
(
const
UT_UniversalLogEntry
&entry,
51
UT_StringHolder
&msg)
const override
;
52
void
writeString
(
UT_ErrorSeverity
severity
,
53
const
UT_StringHolder
&msg)
const override
;
54
55
private
:
56
UT_StringHolder
myFilePath;
57
exint
myMaxFileSize = -1;
58
bool
myAppendDate =
false
;
59
unsigned
int
myPermissions = 0;
60
61
mutable
bool
myHasAdjustedPermissions =
false
;
62
};
63
64
#endif // __UT_UNIVERSALLOGFILESINK_H__
65
UT_UniversalLogFileSink::maxFileSize
exint maxFileSize() const
Definition:
UT_UniversalLogFileSink.h:41
exint
int64 exint
Definition:
SYS_Types.h:125
UT_API.h
UT_ErrorSeverity
UT_ErrorSeverity
Definition:
UT_Error.h:25
UT_API
#define UT_API
Definition:
UT_API.h:14
UT_UniversalLogFileSink::permissions
unsigned int permissions() const
Definition:
UT_UniversalLogFileSink.h:47
UT_UniversalLogFileSink::~UT_UniversalLogFileSink
~UT_UniversalLogFileSink() override
Definition:
UT_UniversalLogFileSink.h:30
UT_StringHolder
Definition:
UT_StringHolder.h:999
UT_UniversalLogFileSink::setMaxFileSize
void setMaxFileSize(exint max_size)
Definition:
UT_UniversalLogFileSink.h:40
UT_UniversalLogFileLikeSink::formatLogEntry
virtual void formatLogEntry(const UT_UniversalLogEntry &entry, UT_StringHolder &msg) const =0
UT_UniversalLogFileSink::filePath
const UT_StringHolder & filePath() const
Definition:
UT_UniversalLogFileSink.h:37
UT_UniversalLogFileSink
Definition:
UT_UniversalLogFileSink.h:22
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_UniversalLogFileSink::appendDate
bool appendDate() const
Definition:
UT_UniversalLogFileSink.h:44
UT_UniversalLogFileSink::setAppendDate
void setAppendDate(bool adate)
Definition:
UT_UniversalLogFileSink.h:43
UT_UniversalLogFileSink::UT_UniversalLogFileSink
UT_UniversalLogFileSink(const UT_StringHolder &filepath)
Definition:
UT_UniversalLogFileSink.h:26
UT_UniversalLogFileSink::setPermissions
void setPermissions(unsigned int perms)
Definition:
UT_UniversalLogFileSink.h:46
UT_UniversalLogEntry
Simple object to hold the data associated with a single log entry event.
Definition:
UT_UniversalLogEntry.h:58
UT_Error.h
UT_UniversalLogSink::disconnectAll
void disconnectAll()
UT_UniversalLogFileLikeSink
Definition:
UT_UniversalLogFileLikeSink.h:24
UT
UT_UniversalLogFileSink.h
Generated on Thu Nov 21 2024 02:46:17 for HDK by
1.8.6