|
Oolite
|
import "OOLogOutputHandler.h"import "NSFileManagerOOExtensions.h"import "NSThreadOOExtensions.h"import "OOAsyncQueue.h"import "OOLogging.h"#include <SDL3/SDL_stdinc.h>#include <stdio.h>#include <stdlib.h>#include <dlfcn.h>Go to the source code of this file.
Classes | |
| class | OOAsyncLogger |
Macros | |
| #define | OOLOG_POISON_NSLOG 0 |
| #define | SET_CRASH_REPORTER_INFO 1 |
| #define | kFlushInterval 2.0 |
Typedefs | |
| typedef void(* | LogCStringFunctionProc) (const char *string, unsigned length, BOOL withSyslogBanner) |
| typedef LogCStringFunctionProc(* | LogCStringFunctionGetterProc) (void) |
| typedef void(* | LogCStringFunctionSetterProc) (LogCStringFunctionProc) |
Enumerations | |
| enum | { kConditionReadyToDealloc = 1 , kConditionWorking } |
Functions | |
| static void | InitCrashReporterInfo (void) |
| static void | SetCrashReporterInfo (const char *info) |
| static void | LoadLogCStringFunctions (void) |
| static void | OONSLogCStringFunction (const char *string, unsigned length, BOOL withSyslogBanner) |
| static NSString * | GetAppName (void) |
| static BOOL | DirectoryExistCreatingIfNecessary (NSString *path) |
| void | OOLogOutputHandlerInit (void) |
| void | OOLogOutputHandlerClose (void) |
| void | OOLogOutputHandlerStartLoggingToStdout () |
| void | OOLogOutputHandlerStopLoggingToStdout () |
| void | OOLogOutputHandlerPrint (NSString *string) |
| NSString * | OOLogHandlerGetLogPath (void) |
| void | OOLogOutputHandlerChangeLogFile (NSString *newLogName) |
| static void | ExcludeFromTimeMachine (NSString *path) |
| NSString * | OOLogHandlerGetLogBasePath (void) |
Variables | |
| static BOOL | sCrashReporterInfoAvailable = NO |
| static LogCStringFunctionGetterProc | _NSLogCStringFunction = NULL |
| static LogCStringFunctionSetterProc | _NSSetLogCStringFunction = NULL |
| static LogCStringFunctionProc | sDefaultLogCStringFunction = NULL |
| static BOOL | sInited = NO |
| static BOOL | sWriteToStderr = YES |
| static BOOL | sWriteToStdout = NO |
| static BOOL | sSaturated = NO |
| static OOAsyncLogger * | sLogger = nil |
| static NSString * | sLogFileName = @"@"Latest.log" |
| static char ** | sCrashReporterInfo = NULL |
| static char * | sOldCrashReporterInfo = NULL |
| static NSLock * | sCrashReporterInfoLock = nil |
| #define kFlushInterval 2.0 |
Definition at line 82 of file OOLogOutputHandler.m.
| #define OOLOG_POISON_NSLOG 0 |
Definition at line 29 of file OOLogOutputHandler.m.
| #define SET_CRASH_REPORTER_INFO 1 |
Definition at line 48 of file OOLogOutputHandler.m.
| typedef LogCStringFunctionProc(* LogCStringFunctionGetterProc) (void) |
Definition at line 59 of file OOLogOutputHandler.m.
| typedef void(* LogCStringFunctionProc) (const char *string, unsigned length, BOOL withSyslogBanner) |
Definition at line 58 of file OOLogOutputHandler.m.
| typedef void(* LogCStringFunctionSetterProc) (LogCStringFunctionProc) |
Definition at line 60 of file OOLogOutputHandler.m.
| anonymous enum |
| Enumerator | |
|---|---|
| kConditionReadyToDealloc | |
| kConditionWorking | |
Definition at line 216 of file OOLogOutputHandler.m.
|
static |
Definition at line 499 of file OOLogOutputHandler.m.
Referenced by OOLogHandlerGetLogBasePath().
|
static |
Definition at line 521 of file OOLogOutputHandler.m.
Referenced by OOLogHandlerGetLogBasePath().
|
static |
Definition at line 533 of file OOLogOutputHandler.m.
References nil.
|
static |
Definition at line 606 of file OOLogOutputHandler.m.
References nil, sCrashReporterInfo, sCrashReporterInfoAvailable, and sCrashReporterInfoLock.
Referenced by OOLogOutputHandlerInit().
|
static |
Definition at line 463 of file OOLogOutputHandler.m.
References _NSLogCStringFunction, and _NSSetLogCStringFunction.
Referenced by OOLogOutputHandlerInit().
| NSString * OOLogHandlerGetLogBasePath | ( | void | ) |
Definition at line 552 of file OOLogOutputHandler.m.
References DirectoryExistCreatingIfNecessary(), ExcludeFromTimeMachine(), and nil.
Referenced by ResourceManager::diagnosticFileLocation, and GameController::validateMenuItem:.
| NSString * OOLogHandlerGetLogPath | ( | void | ) |
Definition at line 203 of file OOLogOutputHandler.m.
Referenced by OOAsyncLogger::init, OpenLogFile(), and OOAsyncLogger::startLogging.
| void OOLogOutputHandlerChangeLogFile | ( | NSString * | newLogName | ) |
Definition at line 208 of file OOLogOutputHandler.m.
References OOAsyncLogger::changeFile, and sLogFileName.
Referenced by SwitchLogFile().
| void OOLogOutputHandlerClose | ( | void | ) |
Definition at line 147 of file OOLogOutputHandler.m.
References _NSSetLogCStringFunction, DESTROY, OOAsyncLogger::endLogging, sDefaultLogCStringFunction, sInited, sLogger, and sWriteToStderr.
Referenced by OOLoggingTerminate(), and OOLogOutputHandlerInit().
| void OOLogOutputHandlerInit | ( | void | ) |
Definition at line 111 of file OOLogOutputHandler.m.
References _NSLogCStringFunction, _NSSetLogCStringFunction, InitCrashReporterInfo(), LoadLogCStringFunctions(), nil, OOLog, OOLogOutputHandlerClose(), OONSLogCStringFunction(), sDefaultLogCStringFunction, sInited, sLogger, and sWriteToStderr.
Referenced by OOLoggingInit().
| void OOLogOutputHandlerPrint | ( | NSString * | string | ) |
Definition at line 179 of file OOLogOutputHandler.m.
References OOAsyncLogger::asyncLogMessage:, nil, sCrashReporterInfoAvailable, SetCrashReporterInfo(), sInited, sLogger, sWriteToStderr, and sWriteToStdout.
Referenced by OOLogInsertMarker(), OOLogInternal_(), and OOLogWithFunctionFileAndLineAndArguments().
| void OOLogOutputHandlerStartLoggingToStdout | ( | void | ) |
Definition at line 170 of file OOLogOutputHandler.m.
References sWriteToStdout.
| void OOLogOutputHandlerStopLoggingToStdout | ( | void | ) |
Definition at line 174 of file OOLogOutputHandler.m.
References sWriteToStdout.
|
static |
Definition at line 481 of file OOLogOutputHandler.m.
References OOLogWillDisplayMessagesInClass(), and OOLogWithFunctionFileAndLine().
Referenced by OOLogOutputHandlerInit().
|
static |
Definition at line 619 of file OOLogOutputHandler.m.
References sCrashReporterInfo, sCrashReporterInfoAvailable, and sOldCrashReporterInfo.
Referenced by OOLogOutputHandlerPrint().
|
static |
Definition at line 62 of file OOLogOutputHandler.m.
Referenced by LoadLogCStringFunctions(), and OOLogOutputHandlerInit().
|
static |
Definition at line 63 of file OOLogOutputHandler.m.
Referenced by LoadLogCStringFunctions(), OOLogOutputHandlerClose(), and OOLogOutputHandlerInit().
|
static |
Definition at line 601 of file OOLogOutputHandler.m.
Referenced by InitCrashReporterInfo(), and SetCrashReporterInfo().
|
static |
Definition at line 54 of file OOLogOutputHandler.m.
Referenced by InitCrashReporterInfo(), OOLogOutputHandlerPrint(), and SetCrashReporterInfo().
|
static |
Definition at line 603 of file OOLogOutputHandler.m.
Referenced by InitCrashReporterInfo().
|
static |
Definition at line 70 of file OOLogOutputHandler.m.
Referenced by OOLogOutputHandlerClose(), and OOLogOutputHandlerInit().
|
static |
Definition at line 104 of file OOLogOutputHandler.m.
|
static |
Definition at line 109 of file OOLogOutputHandler.m.
Referenced by OOLogOutputHandlerChangeLogFile().
|
static |
Definition at line 108 of file OOLogOutputHandler.m.
Referenced by OOLogOutputHandlerClose(), OOLogOutputHandlerInit(), and OOLogOutputHandlerPrint().
|
static |
Definition at line 602 of file OOLogOutputHandler.m.
Referenced by SetCrashReporterInfo().
|
static |
Definition at line 107 of file OOLogOutputHandler.m.
Referenced by OOAsyncLogger::asyncLogMessage:, and OOAsyncLogger::loggerThread.
|
static |
Definition at line 105 of file OOLogOutputHandler.m.
Referenced by OOAsyncLogger::changeFile, OOLogOutputHandlerClose(), OOLogOutputHandlerInit(), and OOLogOutputHandlerPrint().
|
static |
Definition at line 106 of file OOLogOutputHandler.m.
Referenced by OOLogOutputHandlerPrint(), OOLogOutputHandlerStartLoggingToStdout(), and OOLogOutputHandlerStopLoggingToStdout().