MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / attach

Method attach

Engine/source/console/consoleLogger.cpp:127–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125//-----------------------------------------------------------------------------
126
127bool ConsoleLogger::attach()
128{
129 if( mFilename == NULL )
130 {
131 Con::errorf( "ConsoleLogger failed to attach: no filename supplied." );
132 return false;
133 }
134
135 // Check to see if this is initialized before using it
136 if( !smInitialized )
137 {
138 if( !init() )
139 {
140 Con::errorf( "ConsoleLogger failed to initalize." );
141 return false;
142 }
143 }
144
145 if( mLogging )
146 return false;
147
148 // Open the filestream
149 mStream.open( mFilename, ( mAppend ? Torque::FS::File::WriteAppend : Torque::FS::File::Write ) );
150
151 // Add this to list of active loggers
152 mActiveLoggers.push_back( this );
153 mLogging = true;
154
155 return true;
156}
157
158//-----------------------------------------------------------------------------
159

Callers 1

consoleLogger.cppFile · 0.45

Calls 4

errorfFunction · 0.70
initFunction · 0.70
openMethod · 0.65
push_backMethod · 0.45

Tested by

no test coverage detected