Oolite 1.91.0.7646-241128-10e222e
|
import "OOLoggingExtended.h"
import "OOPListParsing.h"
import "OOFunctionAttributes.h"
import "ResourceManager.h"
import "OOCollectionExtractors.h"
import "NSThreadOOExtensions.h"
import "OOLogHeader.h"
import "OOLogOutputHandler.h"
Go to the source code of this file.
Classes | |
struct | OOLogIndentStackElement |
Macros | |
#define | OOLOG_POISON_NSLOG 0 |
#define | PER_THREAD_INDENTATION 1 |
#define | USE_INDENT_GLOBALS 0 |
#define | OOLOG_NOT_INITED 1 |
#define | OOLOG_SETTING_SET 0 |
#define | OOLOG_SETTING_RETRIEVE 0 |
#define | OOLOG_UNDEFINED_METACLASS 1 |
#define | OOLOG_BAD_SETTING 1 |
#define | OOLOG_BAD_DEFAULT_SETTING 1 |
#define | OOLOG_BAD_POP_INDENT 1 |
#define | OOLOG_EXCEPTION_IN_LOG 1 |
#define | OOLogInternal(cond, format, ...) |
#define | INDENT_LOCK() |
#define | INDENT_UNLOCK() |
#define | INDENT_FACTOR 2 /* Spaces per indent level */ |
#define | MAX_INDENT 64 /* Maximum number of indentation _spaces_ */ |
Typedefs | |
typedef struct OOLogIndentStackElement | OOLogIndentStackElement |
Functions | |
static void | OOLogInternal_ (const char *inFunction, NSString *inFormat,...) |
static void | LoadExplicitSettings (void) |
static void | LoadExplicitSettingsFromDictionary (NSDictionary *inDict) |
static id | ResolveDisplaySetting (NSString *inMessageClass) |
static id | ResolveMetaClassReference (NSString *inMetaClass, NSMutableSet *ioSeenMetaClasses) |
OOINLINE unsigned | GetIndentLevel (void) PURE_FUNC |
OOINLINE void | SetIndentLevel (unsigned level) |
OOINLINE id | CacheValue (BOOL inValue) PURE_FUNC |
OOINLINE BOOL | Inited (void) |
BOOL | OOLogWillDisplayMessagesInClass (NSString *inMessageClass) |
void | OOLogSetDisplayMessagesInClass (NSString *inClass, BOOL inFlag) |
NSString * | OOLogGetParentMessageClass (NSString *inClass) |
void | OOLogPushIndent (void) |
void | OOLogPopIndent (void) |
void | OOLogIndent (void) |
void | OOLogOutdent (void) |
void | OOLogWithPrefix (NSString *inMessageClass, const char *inFunction, const char *inFile, unsigned long inLine, NSString *inPrefix, NSString *inFormat,...) |
void | OOLogWithFunctionFileAndLine (NSString *inMessageClass, const char *inFunction, const char *inFile, unsigned long inLine, NSString *inFormat,...) |
void | OOLogWithFunctionFileAndLineAndArguments (NSString *inMessageClass, const char *inFunction, const char *inFile, unsigned long inLine, NSString *inFormat, va_list inArguments) |
void | OOLogGenericParameterErrorForFunction (const char *inFunction) |
void | OOLogGenericSubclassResponsibilityForFunction (const char *inFunction) |
BOOL | OOLogShowFunction (void) |
void | OOLogSetShowFunction (BOOL flag) |
BOOL | OOLogShowFileAndLine (void) |
void | OOLogSetShowFileAndLine (BOOL flag) |
BOOL | OOLogShowTime (void) |
void | OOLogSetShowTime (BOOL flag) |
BOOL | OOLogShowMessageClass (void) |
void | OOLogSetShowMessageClass (BOOL flag) |
void | OOLogSetShowMessageClassTemporary (BOOL flag) |
void | OOLoggingInit (void) |
void | OOLoggingTerminate (void) |
void | OOLoggingReloadSettings (void) |
void | OOLogInsertMarker (void) |
NSString * | OOLogAbbreviatedFileName (const char *inName) |
Variables | |
static NSString *const | kIndentLevelKey = @"org.aegidian.oolite.oolog.indentLevel" |
static NSString *const | kIndentStackKey = @"org.aegidian.oolite.oolog.indentStack" |
static BOOL | sInited = NO |
static NSLock * | sLock = nil |
static NSMutableDictionary * | sExplicitSettings = nil |
static NSMutableDictionary * | sDerivedSettingsCache = nil |
static BOOL | sShowFunction = NO |
static BOOL | sShowFileAndLine = NO |
static BOOL | sShowTime = NO |
static BOOL | sShowClass = NO |
static BOOL | sDefaultDisplay = YES |
static BOOL | sOverrideInEffect = NO |
static BOOL | sOverrideValue = NO |
static NSString *const | kTrueToken = @"on" |
static NSString *const | kFalseToken = @"off" |
static NSString *const | kInheritToken = @"inherit" |
static NSMapTable * | sFileNamesCache = NULL |
NSString *const | kOOLogSubclassResponsibility = @"general.error.subclassResponsibility" |
NSString *const | kOOLogParameterError = @"general.error.parameterError" |
NSString *const | kOOLogDeprecatedMethod = @"general.error.deprecatedMethod" |
NSString *const | kOOLogAllocationFailure = @"general.error.allocationFailure" |
NSString *const | kOOLogInconsistentState = @"general.error.inconsistentState" |
NSString *const | kOOLogException = @"exception" |
NSString *const | kOOLogFileNotFound = @"files.notFound" |
NSString *const | kOOLogFileNotLoaded = @"files.notLoaded" |
NSString *const | kOOLogOpenGLError = @"rendering.opengl.error" |
NSString *const | kOOLogUnconvertedNSLog = @"unclassified" |
#define INDENT_FACTOR 2 /* Spaces per indent level */ |
Referenced by OOLogWithFunctionFileAndLineAndArguments().
#define INDENT_LOCK | ( | ) |
Definition at line 298 of file OOLogging.m.
Referenced by OOLogIndent(), and OOLogOutdent().
#define INDENT_UNLOCK | ( | ) |
Definition at line 299 of file OOLogging.m.
Referenced by OOLogIndent(), and OOLogOutdent().
#define MAX_INDENT 64 /* Maximum number of indentation _spaces_ */ |
Referenced by OOLogWithFunctionFileAndLineAndArguments().
#define OOLOG_BAD_DEFAULT_SETTING 1 |
Definition at line 67 of file OOLogging.m.
Referenced by LoadExplicitSettings().
#define OOLOG_BAD_POP_INDENT 1 |
Definition at line 68 of file OOLogging.m.
Referenced by OOLogPopIndent().
#define OOLOG_BAD_SETTING 1 |
Definition at line 66 of file OOLogging.m.
Referenced by LoadExplicitSettingsFromDictionary(), and ResolveMetaClassReference().
#define OOLOG_EXCEPTION_IN_LOG 1 |
Definition at line 69 of file OOLogging.m.
Referenced by OOLogWithFunctionFileAndLineAndArguments().
#define OOLOG_NOT_INITED 1 |
Definition at line 62 of file OOLogging.m.
Referenced by Inited().
#define OOLOG_POISON_NSLOG 0 |
Definition at line 29 of file OOLogging.m.
#define OOLOG_SETTING_RETRIEVE 0 |
Definition at line 64 of file OOLogging.m.
Referenced by OOLogWillDisplayMessagesInClass().
#define OOLOG_SETTING_SET 0 |
Definition at line 63 of file OOLogging.m.
Referenced by LoadExplicitSettings(), and OOLogSetDisplayMessagesInClass().
#define OOLOG_UNDEFINED_METACLASS 1 |
Definition at line 65 of file OOLogging.m.
Referenced by ResolveMetaClassReference().
#define OOLogInternal | ( | cond, | |
format, | |||
... ) |
Definition at line 106 of file OOLogging.m.
Referenced by Inited(), LoadExplicitSettings(), LoadExplicitSettingsFromDictionary(), OOLogPopIndent(), OOLogSetDisplayMessagesInClass(), OOLogWillDisplayMessagesInClass(), OOLogWithFunctionFileAndLineAndArguments(), and ResolveMetaClassReference().
#define PER_THREAD_INDENTATION 1 |
Definition at line 43 of file OOLogging.m.
#define USE_INDENT_GLOBALS 0 |
Definition at line 51 of file OOLogging.m.
typedef struct OOLogIndentStackElement OOLogIndentStackElement |
Definition at line 73 of file OOLogging.m.
OOINLINE id CacheValue | ( | BOOL | inValue | ) |
Definition at line 127 of file OOLogging.m.
References kFalseToken, and kTrueToken.
Referenced by LoadExplicitSettingsFromDictionary(), OOLogSetDisplayMessagesInClass(), ResolveDisplaySetting(), and ResolveMetaClassReference().
OOINLINE unsigned GetIndentLevel | ( | void | ) |
Definition at line 302 of file OOLogging.m.
Referenced by OOLogIndent(), OOLogOutdent(), and OOLogWithFunctionFileAndLineAndArguments().
OOINLINE BOOL Inited | ( | void | ) |
Definition at line 136 of file OOLogging.m.
References EXPECT, OOLOG_NOT_INITED, OOLogInternal, and sInited.
Referenced by OOLogSetDisplayMessagesInClass(), and OOLogWillDisplayMessagesInClass().
|
static |
Definition at line 705 of file OOLogging.m.
References ResourceManager::builtInPath, DESTROY, kFalseToken, kTrueToken, LoadExplicitSettingsFromDictionary(), ResourceManager::logControlDictionary, nil, OODictionaryFromFile(), OOLOG_BAD_DEFAULT_SETTING, OOLOG_SETTING_SET, OOLogInternal, sDefaultDisplay, sDerivedSettingsCache, sExplicitSettings, sOverrideInEffect, sOverrideValue, sShowClass, sShowFileAndLine, sShowFunction, and sShowTime.
Referenced by OOLoggingInit(), and OOLoggingReloadSettings().
|
static |
Definition at line 777 of file OOLogging.m.
References CacheValue(), foreachkey, kFalseToken, kTrueToken, nil, OOLOG_BAD_SETTING, and OOLogInternal.
Referenced by LoadExplicitSettings().
NSString * OOLogAbbreviatedFileName | ( | const char * | inName | ) |
Definition at line 839 of file OOLogging.m.
References EXPECT_NOT, nil, and sFileNamesCache.
Referenced by OOJSStopTimeLimiter_(), and OOJSUnreachable().
void OOLogGenericParameterErrorForFunction | ( | const char * | inFunction | ) |
Definition at line 495 of file OOLogging.m.
References kOOLogParameterError, and OOLog.
void OOLogGenericSubclassResponsibilityForFunction | ( | const char * | inFunction | ) |
Definition at line 501 of file OOLogging.m.
References kOOLogSubclassResponsibility, and OOLog.
NSString * OOLogGetParentMessageClass | ( | NSString * | inClass | ) |
Definition at line 207 of file OOLogging.m.
References nil.
Referenced by ResolveDisplaySetting().
void OOLoggingInit | ( | void | ) |
Definition at line 585 of file OOLogging.m.
References LoadExplicitSettings(), nil, OOLogOutputHandlerInit(), OOPrintLogHeader(), sFileNamesCache, sInited, and sLock.
Referenced by main(), and main().
void OOLoggingReloadSettings | ( | void | ) |
Definition at line 626 of file OOLogging.m.
References LoadExplicitSettings().
void OOLoggingTerminate | ( | void | ) |
Definition at line 612 of file OOLogging.m.
References OOLogOutputHandlerClose(), and sInited.
void OOLogIndent | ( | void | ) |
Definition at line 366 of file OOLogging.m.
References GetIndentLevel(), INDENT_LOCK, INDENT_UNLOCK, and SetIndentLevel().
Referenced by GLDumpCullingState(), GLDumpFogState(), GLDumpLightState(), GLDumpMaterialState(), GLDumpStateFlags(), LogOpenGLState(), OOCheckOpenGLErrors(), OOJSBeginProfiling(), OOJSProfileEnter(), and VerifyOpenGLStateInternal().
void OOLogInsertMarker | ( | void | ) |
Definition at line 632 of file OOLogging.m.
References nil, and OOLogOutputHandlerPrint().
Referenced by ConsoleWriteLogMarker().
|
static |
Definition at line 662 of file OOLogging.m.
References nil, and OOLogOutputHandlerPrint().
void OOLogOutdent | ( | void | ) |
Definition at line 376 of file OOLogging.m.
References GetIndentLevel(), INDENT_LOCK, INDENT_UNLOCK, and SetIndentLevel().
Referenced by OOTimeProfileEntry(Private)::addSampleWithTotalTime:selfTime:, GLDumpCullingState(), GLDumpFogState(), GLDumpLightState(), GLDumpMaterialState(), GLDumpStateFlags(), LogOpenGLState(), OOCheckOpenGLErrors(), OOJSEndProfiling(), and VerifyOpenGLStateInternal().
void OOLogPopIndent | ( | void | ) |
Definition at line 340 of file OOLogging.m.
References nil, OOLOG_BAD_POP_INDENT, and OOLogInternal.
void OOLogPushIndent | ( | void | ) |
Definition at line 316 of file OOLogging.m.
References OOLogIndentStackElement::indent, OOLogIndentStackElement::link, and nil.
void OOLogSetDisplayMessagesInClass | ( | NSString * | inClass, |
BOOL | inFlag ) |
Definition at line 182 of file OOLogging.m.
References CacheValue(), DESTROY, Inited(), nil, OOLOG_SETTING_SET, OOLogInternal, and sDerivedSettingsCache.
Referenced by ConsoleSetDisplayMessagesInClass().
void OOLogSetShowFileAndLine | ( | BOOL | flag | ) |
Definition at line 531 of file OOLogging.m.
References sShowFileAndLine.
void OOLogSetShowFunction | ( | BOOL | flag | ) |
Definition at line 513 of file OOLogging.m.
References sShowFunction.
void OOLogSetShowMessageClass | ( | BOOL | flag | ) |
Definition at line 567 of file OOLogging.m.
References sShowClass.
void OOLogSetShowMessageClassTemporary | ( | BOOL | flag | ) |
Definition at line 579 of file OOLogging.m.
References sShowClass.
void OOLogSetShowTime | ( | BOOL | flag | ) |
Definition at line 549 of file OOLogging.m.
References sShowTime.
BOOL OOLogShowFileAndLine | ( | void | ) |
Definition at line 525 of file OOLogging.m.
References sShowFileAndLine.
BOOL OOLogShowFunction | ( | void | ) |
Definition at line 507 of file OOLogging.m.
References sShowFunction.
BOOL OOLogShowMessageClass | ( | void | ) |
BOOL OOLogShowTime | ( | void | ) |
BOOL OOLogWillDisplayMessagesInClass | ( | NSString * | inMessageClass | ) |
Definition at line 144 of file OOLogging.m.
References EXPECT_NOT, Inited(), kTrueToken, nil, OOLOG_SETTING_RETRIEVE, OOLogInternal, ResolveDisplaySetting(), sDerivedSettingsCache, sOverrideInEffect, and sOverrideValue.
Referenced by ConsoleDisplayMessagesInClass(), GlobalLog(), LogOpenGLState(), OOCheckOpenGLErrors(), OOLogWithFunctionFileAndLineAndArguments(), OOLogWithPrefix(), OONSLogCStringFunction(), ReportJSError(), SyntaxIssue(), and VerifyOpenGLStateInternal().
void OOLogWithFunctionFileAndLine | ( | NSString * | inMessageClass, |
const char * | inFunction, | ||
const char * | inFile, | ||
unsigned long | inLine, | ||
NSString * | inFormat, | ||
... ) |
Definition at line 397 of file OOLogging.m.
References OOLogWithFunctionFileAndLineAndArguments().
void OOLogWithFunctionFileAndLineAndArguments | ( | NSString * | inMessageClass, |
const char * | inFunction, | ||
const char * | inFile, | ||
unsigned long | inLine, | ||
NSString * | inFormat, | ||
va_list | inArguments ) |
Definition at line 407 of file OOLogging.m.
References GetIndentLevel(), OOLogIndentStackElement::indent, INDENT_FACTOR, MAX_INDENT, nil, OOLOG_EXCEPTION_IN_LOG, OOLogInternal, OOLogOutputHandlerPrint(), OOLogWillDisplayMessagesInClass(), sShowClass, sShowFileAndLine, sShowFunction, and sShowTime.
Referenced by OOLogWithFunctionFileAndLine(), and OOLogWithPrefix().
void OOLogWithPrefix | ( | NSString * | inMessageClass, |
const char * | inFunction, | ||
const char * | inFile, | ||
unsigned long | inLine, | ||
NSString * | inPrefix, | ||
NSString * | inFormat, | ||
... ) |
Definition at line 387 of file OOLogging.m.
References OOLogWillDisplayMessagesInClass(), and OOLogWithFunctionFileAndLineAndArguments().
|
static |
Definition at line 861 of file OOLogging.m.
References CacheValue(), kFalseToken, kInheritToken, kTrueToken, nil, OOLogGetParentMessageClass(), ResolveDisplaySetting(), ResolveMetaClassReference(), and sDefaultDisplay.
Referenced by OOLogWillDisplayMessagesInClass(), and ResolveDisplaySetting().
|
static |
Definition at line 885 of file OOLogging.m.
References CacheValue(), kFalseToken, kTrueToken, nil, OOLOG_BAD_SETTING, OOLOG_UNDEFINED_METACLASS, OOLogInternal, ResolveMetaClassReference(), and sDefaultDisplay.
Referenced by ResolveDisplaySetting(), and ResolveMetaClassReference().
OOINLINE void SetIndentLevel | ( | unsigned | level | ) |
Definition at line 309 of file OOLogging.m.
Referenced by OOLogIndent(), and OOLogOutdent().
|
static |
Definition at line 101 of file OOLogging.m.
Referenced by CacheValue(), LoadExplicitSettings(), LoadExplicitSettingsFromDictionary(), ResolveDisplaySetting(), and ResolveMetaClassReference().
|
static |
Definition at line 52 of file OOLogging.m.
|
static |
Definition at line 53 of file OOLogging.m.
|
static |
Definition at line 102 of file OOLogging.m.
Referenced by ResolveDisplaySetting().
NSString* const kOOLogAllocationFailure = @"general.error.allocationFailure" |
Definition at line 649 of file OOLogging.m.
Referenced by OOMeshToOctreeConverter::addTriangle:.
NSString* const kOOLogDeprecatedMethod = @"general.error.deprecatedMethod" |
Definition at line 648 of file OOLogging.m.
NSString* const kOOLogException = @"exception" |
Definition at line 651 of file OOLogging.m.
Referenced by AI::clearAllData, main(), MissionRunCallback(), and OOJSDumpStack().
NSString* const kOOLogFileNotFound = @"files.notFound" |
Definition at line 652 of file OOLogging.m.
NSString* const kOOLogFileNotLoaded = @"files.notLoaded" |
Definition at line 653 of file OOLogging.m.
NSString* const kOOLogInconsistentState = @"general.error.inconsistentState" |
Definition at line 650 of file OOLogging.m.
NSString* const kOOLogOpenGLError = @"rendering.opengl.error" |
Definition at line 654 of file OOLogging.m.
Referenced by OOCheckOpenGLErrors().
NSString* const kOOLogParameterError = @"general.error.parameterError" |
Definition at line 647 of file OOLogging.m.
Referenced by OOConcreteTexture::apply, OOGenerateMipMaps(), OOInterpretTextureSpecifier(), and OOLogGenericParameterErrorForFunction().
NSString* const kOOLogSubclassResponsibility = @"general.error.subclassResponsibility" |
Definition at line 646 of file OOLogging.m.
Referenced by OOLogGenericSubclassResponsibilityForFunction().
NSString* const kOOLogUnconvertedNSLog = @"unclassified" |
Definition at line 655 of file OOLogging.m.
|
static |
Definition at line 100 of file OOLogging.m.
Referenced by CacheValue(), LoadExplicitSettings(), LoadExplicitSettingsFromDictionary(), OOLogWillDisplayMessagesInClass(), ResolveDisplaySetting(), and ResolveMetaClassReference().
|
static |
Definition at line 95 of file OOLogging.m.
Referenced by LoadExplicitSettings(), ResolveDisplaySetting(), and ResolveMetaClassReference().
|
static |
Definition at line 85 of file OOLogging.m.
Referenced by LoadExplicitSettings(), OOLogSetDisplayMessagesInClass(), and OOLogWillDisplayMessagesInClass().
|
static |
Definition at line 84 of file OOLogging.m.
Referenced by LoadExplicitSettings().
|
static |
Definition at line 121 of file OOLogging.m.
Referenced by OOLogAbbreviatedFileName(), and OOLoggingInit().
|
static |
Definition at line 82 of file OOLogging.m.
Referenced by Inited(), OOLoggingInit(), and OOLoggingTerminate().
|
static |
Definition at line 83 of file OOLogging.m.
Referenced by OOLoggingInit().
|
static |
Definition at line 96 of file OOLogging.m.
Referenced by LoadExplicitSettings(), and OOLogWillDisplayMessagesInClass().
|
static |
Definition at line 97 of file OOLogging.m.
Referenced by LoadExplicitSettings(), and OOLogWillDisplayMessagesInClass().
|
static |
Definition at line 94 of file OOLogging.m.
Referenced by LoadExplicitSettings(), OOLogSetShowMessageClass(), OOLogSetShowMessageClassTemporary(), OOLogShowMessageClass(), and OOLogWithFunctionFileAndLineAndArguments().
|
static |
Definition at line 92 of file OOLogging.m.
Referenced by LoadExplicitSettings(), OOLogSetShowFileAndLine(), OOLogShowFileAndLine(), and OOLogWithFunctionFileAndLineAndArguments().
|
static |
Definition at line 91 of file OOLogging.m.
Referenced by LoadExplicitSettings(), OOLogSetShowFunction(), OOLogShowFunction(), and OOLogWithFunctionFileAndLineAndArguments().
|
static |
Definition at line 93 of file OOLogging.m.
Referenced by LoadExplicitSettings(), OOLogSetShowTime(), OOLogShowTime(), and OOLogWithFunctionFileAndLineAndArguments().