]> Dogcows Code - chaz/thecheat/blobdiff - ChazLog.m
Remove support of Mac OS X 10.3 and earlier system, change codes for Mac OS X 10.7.
[chaz/thecheat] / ChazLog.m
index 1637e56f3e484bc0b11d5091284ed723b50c9d20..2f8eaa6cde97fc05c19e2fb46c4c8fe863602482 100644 (file)
--- a/ChazLog.m
+++ b/ChazLog.m
@@ -1,10 +1,14 @@
-//
-//  ChazLog.m
-//  Niobium
-//
-//  Created by NB McGarvey on 9/6/04.
-//  Copyright 2004 NB McGarvey. All rights reserved.
-//
+
+/*
+ * The Cheat - The legendary universal game trainer for Mac OS X.
+ * http://www.brokenzipper.com/trac/wiki/TheCheat
+ *
+ * Copyright (c) 2003-2011, Charles McGarvey et al.
+ *
+ * Distributable under the terms and conditions of the 2-clause BSD
+ * license; see the file COPYING for the legal text of the license.
+ */
+
 
 #include "ChazLog.h"
 
@@ -17,7 +21,7 @@ void static _ChazPrint( FILE *output, NSString *format, va_list args );
 
 
 // Static Globals
-BOOL static _gLogEnabled = NO;
+BOOL static _gLogEnabled = YES;
 FILE static *_gLogFile = stdout;
 FILE static *_gDebugFile = NULL;
 
@@ -45,7 +49,7 @@ void ChazDebugSetup()
        FILE *file;
        
        // look for debug file
-       file = fopen( [filepath lossyCString], "r+" );
+       file = fopen( [filepath cStringUsingEncoding:NSUTF8StringEncoding], "r+" );
        
        if ( !file ) {
                // there is no debug file or we don't have permissions
@@ -54,7 +58,7 @@ void ChazDebugSetup()
        
        fclose( file );
        
-       _gDebugFile = fopen( [filepath lossyCString], "w" );
+       _gDebugFile = fopen( [filepath cStringUsingEncoding:NSUTF8StringEncoding], "w" );
        
        ChazDebug( @"Debug log found (obviously).  Entering debug mode." );
 }
@@ -146,7 +150,7 @@ void _ChazPrint( FILE *output, NSString *format, va_list args )
        
        fprintf( output, "[%s] %s\n", [[[NSDate date] descriptionWithCalendarFormat:@"%Y-%m-%d %H:%M:%S.%F"
                                                                                                                                           timeZone:nil
-                                                                                                                                                locale:nil] lossyCString], [string lossyCString] );
+                                                                                                                                                locale:nil] cStringUsingEncoding:NSUTF8StringEncoding], [string cStringUsingEncoding:NSUTF8StringEncoding] );
        fflush( output );
        
        [string release];
This page took 0.021913 seconds and 4 git commands to generate.