Oolite 1.91.0.7671-250514-dc597d5
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
OOOXPVerifier.m File Reference
+ Include dependency graph for OOOXPVerifier.m:

Go to the source code of this file.

Classes

category  OOOXPVerifier(OOPrivate)
 

Functions

static void SwitchLogFile (NSString *name)
 
static void NoteVerificationStage (NSString *displayName, NSString *stage)
 
static void OpenLogFile (NSString *name)
 

Function Documentation

◆ NoteVerificationStage()

static void NoteVerificationStage ( NSString * displayName,
NSString * stage )
static

Definition at line 726 of file OOOXPVerifier.m.

727{
728 [[GameController sharedController] logProgress:[NSString stringWithFormat:@"Verifying %@\n%@", displayName, stage]];
729}
GameController * sharedController()
void logProgress:(NSString *message)

References GameController::logProgress:, and GameController::sharedController.

Referenced by OOOXPVerifier(OOPrivate)::run, and OOOXPVerifier(OOPrivate)::runStages.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OpenLogFile()

static void OpenLogFile ( NSString * name)
static

Definition at line 732 of file OOOXPVerifier.m.

733{
734 // Open log file in appropriate application / provide feedback.
735
736 if ([[NSUserDefaults standardUserDefaults] oo_boolForKey:@"oxp-verifier-open-log" defaultValue:YES])
737 {
738#if OOLITE_MAC_OS_X
739 [[NSWorkspace sharedWorkspace] openFile:OOLogHandlerGetLogPath()];
740#elif OOLITE_WINDOWS
741 // identify the application set by the OS as the default app for opening .log files
742 // in case anything goes wrong, fall back to opening the log file in Motepad
743 DWORD dwSize = MAX_PATH;
744 TCHAR applicationPath[MAX_PATH] = TEXT("notepad");
745 HRESULT hr = AssocQueryString (0, //ASSOCF_NONE
746 ASSOCSTR_EXECUTABLE,
747 _T(".log"),
748 _T("open"),
749 applicationPath,
750 &dwSize);
751
752 if (FAILED (hr))
753 {
754 OOLog(@"OXP Verifier", @"Could not find application for opening .log files - using Notepad by default.");
755 }
756
757 // open the log file
758 system([[NSString stringWithFormat:@"start \"\" \"%s\" \"Logs\\%@.log\"", applicationPath, name] UTF8String]);
759#elif OOLITE_LINUX
760 // MKW - needed to suppress 'ignoring return value' warning for system() call
761 // int ret;
762 // CIM - and now the compiler complains about that too... casting return
763 // value to void seems to keep it quiet for now
764 // Nothing to do here, since we dump to stdout instead of to a file.
765 //OOLogOutputHandlerStopLoggingToStdout();
766 (void) system([[NSString stringWithFormat:@"cat \"%@\"", OOLogHandlerGetLogPath()] UTF8String]);
767#else
768 do {} while (0);
769#endif
770 }
771}
NSString * OOLogHandlerGetLogPath(void)
#define OOLog(class, format,...)
Definition OOLogging.h:88

References OOLog, and OOLogHandlerGetLogPath().

Referenced by OOOXPVerifier(OOPrivate)::run.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SwitchLogFile()

static void SwitchLogFile ( NSString * name)
static

Definition at line 713 of file OOOXPVerifier.m.

714{
715//#ifndef OOLITE_LINUX
716 name = [name stringByAppendingPathExtension:@"log"];
717 OOLog(@"verifyOXP.switchingLog", @"Switching log files -- logging to \"%@\".", name);
719//#else
720// OOLog(@"verifyOXP.switchingLog", @"Switching logging to <stdout>.");
721// OOLogOutputHandlerStartLoggingToStdout();
722//#endif
723}
void OOLogOutputHandlerChangeLogFile(NSString *newLogName)

References OOLog, and OOLogOutputHandlerChangeLogFile().

Referenced by OOOXPVerifier(OOPrivate)::run.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: