| 158 | //----------------------------------------------------------------------------- |
| 159 | |
| 160 | bool ConsoleLogger::detach() |
| 161 | { |
| 162 | |
| 163 | // Make sure this is valid before messing with it |
| 164 | if( !smInitialized ) |
| 165 | { |
| 166 | if( !init() ) |
| 167 | { |
| 168 | return false; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | if( !mLogging ) |
| 173 | return false; |
| 174 | |
| 175 | // Close filestream |
| 176 | mStream.close(); |
| 177 | |
| 178 | // Remove this object from the list of active loggers |
| 179 | for( S32 i = 0; i < mActiveLoggers.size(); i++ ) |
| 180 | { |
| 181 | if( mActiveLoggers[i] == this ) |
| 182 | { |
| 183 | mActiveLoggers.erase( i ); |
| 184 | mLogging = false; |
| 185 | return true; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | return false; // If this happens, it's bad... |
| 190 | } |
| 191 | |
| 192 | //----------------------------------------------------------------------------- |
| 193 |
no test coverage detected