objective c - iOS: NSLogger not writing to file on disk -
i'm trying implement nslogger framework framework. add nslogger project , configure project. here implementation:
#import "appdelegate.h" #import <nslogger/nslogger.h> @interface appdelegate () @end @implementation appdelegate - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsurl *pathdirectory = [[[nsfilemanager defaultmanager] urlsfordirectory:nsdocumentdirectory indomains:nsuserdomainmask] lastobject]; cfstringref path = (__bridge cfstringref)[pathdirectory.path stringbyappendingstring:@"/logs.txt"]; logger *logger = loggerinit(); loggersetoptions(logger,kloggeroption_bufferlogsuntilconnection | kloggeroption_capturesystemconsole | kloggeroption_browsebonjour | kloggeroption_browseonlylocaldomain); loggersetupbonjour(logger, null, null); loggersetbufferfile(logger, path); loggerapp(1, @"hello world! today is: %@", [nsdate date]); loggerapp(0, @"hello world! today is: %@", [nsdate date]); logmessage(@"map view loaded", 0, @"map view loaded"); logmessage(@"map view loaded", 1, @"map view loaded"); logmessagef(nil,50,nil,@"tag mapvc",1,@"testing format"); logmessagef(nil,50,nil,@"level 0",0,@"testing format"); logmessagef(nil,50,nil,@"level 0",0,@"testing format"); return yes; }
everything compiling , running nothing writing logs.txt file. of knows why not writing file or i'm doing wrong?
i'll appreciate help
Comments
Post a Comment