Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which are free available good logging framework for cocoa environment? [duplicate]

As of now I use NSLog for logging from my OS X application. But NSLog gives me no control over log level, size and number of log files. Other problem I face with NSLog is even though I redirect log statements to a file, I still see entries in System log (using console).

I found a logging framework log4cocoa, but this looks very old. Before making decision and start using log4cocoa, I want to know which all free logging frameworks are available for cocoa and merits / demerits of those.

Update: I also found one more logging framework called lumberjack. I am gonna try these two and see how they fair

like image 872
Unicorn Avatar asked Dec 28 '22 23:12

Unicorn


2 Answers

OS X includes a built-in logging facility, the Apple System Logger (ASL). ASL supports multiple output streams, and logging levels.

Peter Hosey's series on the ASL is still the best introduction to the system and its API. The ASL API is in C, but it's quite easy to write an Objective-C wrapper and some preprocessor macros to make your life easier. The Google Toolbox for Mac has the GTMLogger class that supports flat-file, stdout, and ASL (via the GTMLogger+ASL category). If you don't mind taking an additional dependency, I would use GTM and its GTMLogger facilities.

like image 50
Barry Wark Avatar answered Dec 31 '22 14:12

Barry Wark


Check Best Logger for cocoa answers too.

like image 44
djromero Avatar answered Dec 31 '22 14:12

djromero