#include <TLogFile.h>
Definition at line 18 of file TLogFile.h.
◆ Error
Enumerator |
---|
OK | |
OpenFile | |
AlreadyCreated | |
Definition at line 24 of file TLogFile.h.
25 {
26 OK,
27 OpenFile,
28 AlreadyCreated
29 };
◆ TLogFile()
Definition at line 13 of file TLogFile.cpp.
14{
16 m_iTotalLogCount = 0;
18 m_curLevel = 0;
19 *m_LevelString = 0;
20 *m_typeCounts = 0;
22 m_unk3 = 0;
23}
◆ ~TLogFile()
◆ AllowIndentation()
void TLogFile::AllowIndentation |
( |
TBOOL | a_bAllow | ) |
|
|
inline |
Definition at line 46 of file TLogFile.h.
46{ m_bAllowIndentation = a_bAllow; }
◆ Close()
Definition at line 69 of file TLogFile.cpp.
70{
71 m_curLevel = 0;
73
75 {
77 }
78
79 if ( m_pFile !=
TNULL )
80 {
81 m_pFile->Destroy();
83 }
84}
void Print(const TCHAR *format,...)
static constexpr const TCHAR * LogTypeToString(LogType a_eType)
◆ Create()
Definition at line 31 of file TLogFile.cpp.
32{
34
35 if ( m_pFile !=
TNULL )
36 {
38 }
39
42
46
48
49 if ( m_pFile ==
TNULL )
50 {
52 }
53
54 if ( writeExisting )
55 {
57 }
58
59 m_iTotalLogCount = 0;
60 *m_LevelString = 0;
61 m_curLevel = 0;
62
63 m_pFile->CPrintf(
"Log created [%s]:[%s]: %s\n", fileName, str2,
TUtil::GetTime() );
64 m_pFile->CPrintf( "Compilation: %s\n", __TIMESTAMP__ );
65
67}
#define TIMPLEMENT_D(DESC)
static TFile * Create(const TString8 &a_rcFilename, TFILEMODE a_eMode=TFILEMODE_READ)
static const TCHAR * GetTime()
◆ Down()
◆ GetAllowIndentation()
TBOOL TLogFile::GetAllowIndentation |
( |
| ) |
|
|
inline |
Definition at line 47 of file TLogFile.h.
47{ return m_bAllowIndentation; }
◆ GetLevelString()
const TCHAR * TLogFile::GetLevelString |
( |
| ) |
const |
|
inline |
Definition at line 54 of file TLogFile.h.
54{ return m_LevelString; }
◆ GetTotalLogCount()
TINT TLogFile::GetTotalLogCount |
( |
| ) |
const |
|
inline |
Definition at line 53 of file TLogFile.h.
53{ return m_iTotalLogCount; }
◆ GetTypeCount()
Definition at line 52 of file TLogFile.h.
52{ return m_typeCounts[ a_eType ]; }
◆ IsSimpleMode()
TBOOL TLogFile::IsSimpleMode |
( |
| ) |
|
|
inline |
Definition at line 50 of file TLogFile.h.
50{ return m_bIsSimpleMode; }
◆ Log()
Definition at line 122 of file TLogFile.cpp.
123{
124 if ( m_pFile !=
TNULL )
125 {
126 if ( m_bIsSimpleMode )
127 {
128 if ( m_bAllowIndentation )
129 {
130 m_pFile->CPrintf(
131 "%d [%s]: %s",
132 m_iTotalLogCount,
134 m_LevelString
135 );
136 }
137 }
138 else
139 {
140 TCHAR strTime[ 128 ];
141 _strtime( strTime );
142
143 m_pFile->CPrintf(
144 "%d [%s] [%s]: %s: %s: %s",
145 m_iTotalLogCount,
147 strTime,
148 str1,
149 str2 !=
TNULL ? str2 :
"",
150 !m_bAllowIndentation ? m_LevelString : ""
151 );
152 }
153
154 va_list args;
155 va_start( args, format );
158 va_end( args );
159
160 m_typeCounts[ type ]++;
161 m_iTotalLogCount++;
162 }
163}
static TINT FormatV(TCHAR *a_pcString, TINT size, const TCHAR *a_pcFormat, va_list args)
static TCHAR * GetTempString8()
◆ Print()
void TLogFile::Print |
( |
const TCHAR * | format, |
|
|
| ... ) |
Definition at line 99 of file TLogFile.cpp.
100{
101 if ( m_pFile !=
TNULL )
102 {
103 va_list args;
104 va_start( args, format );
105
108
109 va_end( args );
110
111 if ( m_bAllowIndentation )
112 {
113 m_pFile->CPrintf( "%s%s", m_LevelString, str );
114 }
115 else
116 {
117 m_pFile->CPrintf( str );
118 }
119 }
120}
◆ RecalcLevel()
void TLogFile::RecalcLevel |
( |
| ) |
|
Definition at line 86 of file TLogFile.cpp.
87{
90
91 for (
TSIZE i = 0; i < m_curLevel; i++ )
92 {
93 m_LevelString[ i ] = 9;
94 }
95
96 m_LevelString[ m_curLevel ] = 0;
97}
TFORCEINLINE const T & Max(const T &a, const T &b)
TFORCEINLINE const T & Min(const T &a, const T &b)
◆ SetSimpleMode()
void TLogFile::SetSimpleMode |
( |
TBOOL | a_bEnable | ) |
|
|
inline |
Definition at line 49 of file TLogFile.h.
49{ m_bIsSimpleMode = a_bEnable; }
◆ Up()
The documentation for this class was generated from the following files:
- D:/_dev/OpenBarnyard/Source/Toshi/Source/File/TLogFile.h
- D:/_dev/OpenBarnyard/Source/Toshi/Source/File/TLogFile.cpp