22

Is there a logging framework for iOS that could aid developers in diagnosing app crashes?

Carter Allen
  • 1,984
  • 15
  • 22
thndrkiss
  • 4,515
  • 8
  • 57
  • 96
  • 1
    do you mean logging in terms of debugging on your own test equipment or logging user activity when app is in production? – dusker Jun 28 '10 at 07:10
  • @dusker: For production as well as for debugging during development of the app. – thndrkiss Jun 28 '10 at 08:39

6 Answers6

53

You may like:

"It is similar in concept to other popular logging frameworks such as log4j, yet is designed specifically for Objective-C, and takes advantage of features such as multi-threading, grand central dispatch (if available), lockless atomic operations, and the dynamic nature of the Objective-C runtime."

"LibComponentLogging is a small logging library for Objective-C applications on Mac OS X and the iPhone OS which provides conditional logging based on log levels and log components. Additionally, different logging strategies can be used, e.g. writing log messages to a file or sending them to the system log, while using the same logging interface."

  • NSLogger: fancy with a dedicated visualization OS X App

"NSLogger is a high perfomance logging utility which displays traces emitted by client applications running on Mac OS X or iOS (iPhone OS). It replaces your usual NSLog()-based traces and provides powerful additions like display filtering, image and binary logging, traces buffering, timing information, etc."

Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
IlDan
  • 6,851
  • 3
  • 33
  • 34
  • Also don't forget Apple's standard ASL library. With a few wrapper functions you can get very nice logging with multiple trace levels (debug, info, warning, error, ... etc.). – Mike Weller Apr 23 '13 at 18:42
7

I know this post is old but I'm looking for one as well. I found one called Lumberjack, though I haven't tried it yet.

Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
Victor P
  • 1,496
  • 17
  • 29
4

I created a simple logging framework that might help. I'd appreciate any feedback you have. Hope it helps.

Link to Project Page

JAgostoni
  • 129
  • 2
3

This previous question seems to overlap. But the bottom line is:

NSLog(@"message");

or:

printf("message");

Community
  • 1
  • 1
Blake Ramsdell
  • 341
  • 2
  • 5
1

I have a slightly different need: not only do I want to debug crashes, but I also need to debug other errors (NSError, NSException).

I tried all 3 packages mentioned in IlDan's answer. However, all of them require me to adopt a new way of logging, which may not be compatible with the libraries I depend on. For example, I intended to adopt NSLogger but RestKit, which is an important library in my project, uses LibComponentLogging.

So I ended up with writing a small pod (https://github.com/kennethjiang/Teleport-NSLog) for that. The mechanism is to redirect stderr (where NSLog + all these logging frameworks write messages to) to a backend HTTP server. Now I can debug my app running in user's device just as if it was running in my xcode. :)

Kenneth Jiang
  • 589
  • 7
  • 13
0

For basic logging use NSLog(@"your message here") If you want more flexible logging look into Lumberjack. It can let you disable logging in production etc etc.

Quinn Taylor
  • 44,553
  • 16
  • 113
  • 131
Niklas Berglund
  • 3,563
  • 4
  • 32
  • 32