Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOLogHeader.h File Reference
import "OOCocoa.h"
+ Include dependency graph for OOLogHeader.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void OOPrintLogHeader (void)
 

Function Documentation

◆ OOPrintLogHeader()

void OOPrintLogHeader ( void )

Definition at line 60 of file OOLogHeader.m.

61{
62 // Bunch of string literal macros which are assembled into a CPU info string.
63 #if defined (__ppc__)
64 #define CPU_TYPE_STRING "PPC-32"
65 #elif defined (__ppc64__)
66 #define CPU_TYPE_STRING "PPC-64"
67 #elif defined (__i386__)
68 #define CPU_TYPE_STRING "x86-32"
69 #elif defined (__x86_64__)
70 #define CPU_TYPE_STRING "x86-64"
71 #else
72 #if OOLITE_BIG_ENDIAN
73 #define CPU_TYPE_STRING "<unknown big-endian architecture>"
74 #elif OOLITE_LITTLE_ENDIAN
75 #define CPU_TYPE_STRING "<unknown little-endian architecture>"
76 #else
77 #define CPU_TYPE_STRING "<unknown architecture with unknown byte order>"
78 #endif
79 #endif
80
81 #if OOLITE_MAC_OS_X
82 #define OS_TYPE_STRING "Mac OS X"
83 #elif OOLITE_WINDOWS
84 #define OS_TYPE_STRING "Windows"
85 #elif OOLITE_LINUX
86 #define OS_TYPE_STRING "Linux" // Hmm, what about other unices?
87 #elif OOLITE_SDL
88 #define OS_TYPE_STRING "unknown SDL system"
89 #else
90 #define OS_TYPE_STRING "unknown system"
91 #endif
92
93 #if OO_DEBUG
94 #define RELEASE_VARIANT_STRING " debug"
95 #elif !defined (NDEBUG)
96 #define RELEASE_VARIANT_STRING " test release"
97 #else
98 #define RELEASE_VARIANT_STRING ""
99 #endif
100
101 NSArray *featureStrings = [NSArray arrayWithObjects:
102 // User features
103 #if OOLITE_OPENAL
104 @"OpenAL",
105 #endif
106
107 #if OO_SHADERS
108 @"GLSL shaders",
109 #endif
110
111 #if NEW_PLANETS
112 @"new planets",
113 #endif
114
115 // Debug features
116 #if OO_CHECK_GL_HEAVY
117 @"heavy OpenGL error checking",
118 #endif
119
120 #ifndef OO_EXCLUDE_DEBUG_SUPPORT
121 @"JavaScript console support",
122 #if OOLITE_MAC_OS_X
123 // Under Mac OS X, Debug.oxp adds more than console support.
124 @"Debug plug-in support",
125 #endif
126 #endif
127
128 #if OO_OXP_VERIFIER_ENABLED
129 @"OXP verifier",
130 #endif
131
132 #if OO_LOCALIZATION_TOOLS
133 @"localization tools",
134 #endif
135
136 #if DEBUG_GRAPHVIZ
137 @"debug GraphViz support",
138 #endif
139
140 #if OOJS_PROFILE
141 #ifdef MOZ_TRACE_JSCALLS
142 @"JavaScript profiling",
143 #else
144 @"JavaScript native callback profiling",
145 #endif
146 #endif
147
148 #if OO_FOV_INFLIGHT_CONTROL_ENABLED
149 @"FOV in-flight control",
150 #endif
151
152 nil];
153
154 // systemString: NSString with system type and possibly version.
155 #if (OOLITE_MAC_OS_X || (OOLITE_GNUSTEP_1_20 && !OOLITE_WINDOWS))
156 NSString *systemString = [NSString stringWithFormat:@OS_TYPE_STRING " %@", [[NSProcessInfo processInfo] operatingSystemVersionString]];
157 #elif OOLITE_WINDOWS
158 NSString *systemString = [NSString stringWithFormat:@OS_TYPE_STRING " %@ %@-bit", operatingSystemFullVersion(), is64BitSystem() ? @"64":@"32"];
159 #else
160 #define systemString @OS_TYPE_STRING
161 #endif
162
163 NSString *versionString = nil;
164 #if (defined (SNAPSHOT_BUILD) && defined (OOLITE_SNAPSHOT_VERSION))
165 versionString = @"development version " OOLITE_SNAPSHOT_VERSION;
166 #else
167 versionString = [NSString stringWithFormat:@"version %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]];
168 #endif
169 if (versionString == nil) versionString = @"<unknown version>";
170
171 NSMutableString *miscString = [NSMutableString stringWithFormat:@"Opening log for Oolite %@ (" CPU_TYPE_STRING RELEASE_VARIANT_STRING ") under %@ at %@.\n", versionString, systemString, [NSDate date]];
172
173 [miscString appendString:AdditionalLogHeaderInfo()];
174
175 NSString *featureDesc = [featureStrings componentsJoinedByString:@", "];
176 if ([featureDesc length] == 0) featureDesc = @"none";
177 [miscString appendFormat:@"\nBuild options: %@.\n", featureDesc];
178
179 [miscString appendString:@"\nNote that the contents of the log file can be adjusted by editing logcontrol.plist."];
180
181 OOLog(@"log.header", @"%@\n", miscString);
182}
#define CPU_TYPE_STRING
#define RELEASE_VARIANT_STRING
#define OS_TYPE_STRING
static NSString * AdditionalLogHeaderInfo(void)
#define OOLog(class, format,...)
Definition OOLogging.h:88
return nil

References nil, and OOLog.

Referenced by OOLoggingInit().

+ Here is the caller graph for this function: