Logging Framework for iOS? [closed]

2019-03-10 23:29发布

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

标签: ios logging
6条回答
女痞
2楼-- · 2019-03-11 00:01

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

NSLog(@"message");

or:

printf("message");

查看更多
冷血范
3楼-- · 2019-03-11 00:04

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."

查看更多
倾城 Initia
4楼-- · 2019-03-11 00:08

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.

查看更多
来,给爷笑一个
5楼-- · 2019-03-11 00:17

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. :)

查看更多
爷、活的狠高调
6楼-- · 2019-03-11 00:20

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

Link to Project Page

查看更多
不美不萌又怎样
7楼-- · 2019-03-11 00:22

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.

查看更多
登录 后发表回答