fpillet / NSLogger

A modern, flexible logging tool
Other
5k stars 573 forks source link

example on how to log to a file #293

Open rahul-dutt-sharma opened 4 years ago

rahul-dutt-sharma commented 4 years ago

In objc

LoggerSetBufferFile(NULL, CFSTR("/Users/rahulsharma/Desktop/demo.rawnsloggerdata"));
NSLog(@"Some message to NSLog %d", (int)arc4random());

LoggerStop(NULL);

writes to a file but the desktop app does not open the raw file. I could verify that the log was in there.

Is it possible to write to a file consistently and not via a buffer thats written before LoggerStop

clarexine commented 4 years ago

Je pense avoir le même problème:

Projet iOS en swift compilé avec le pod NSLogger 1.9.7 Ecriture d'un fichier nsloggerbuffer.rawnsloggerdata Le fichier ne s'ouvre pas avec l'application NSLogger Desktop Mac 1.9.7. Message de la console:

NSLogger(62503,0x70000117d000) malloc: error for object 0x10fba44d5: pointer being freed was not allocated NSLogger(62503,0x70000117d000) malloc: set a breakpoint in malloc_error_break to debug (pas le temps de deboguer!)

Pourtant, ce même fichier s'ouvre avec la version 1.8.3

Cordialement

Dominique

hunble commented 3 years ago

@rahul-dutt-sharma the desktop app was last build on 9 Jan 2019. but the code has changed since then, I downloaded the code and build my own version of the desktop app and it started to open the rawnsloggerdata files.

That seems to be your problem. i can be way off tho. Sorry for my ignorance.