CocoaPods trunk is moving to be read-only. Read more on the blog, there are 12 months to go.
| TestsTested | ✓ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Dec 2014 |
Maintained by Carl Jahn.
A simple wrapper around the <asl.h> log functions
You can log a message with different log levels, these levels are defined in <asl.h>:
#define ASL_LEVEL_EMERG 0
#define ASL_LEVEL_ALERT 1
#define ASL_LEVEL_CRIT 2
#define ASL_LEVEL_ERR 3
#define ASL_LEVEL_WARNING 4
#define ASL_LEVEL_NOTICE 5
#define ASL_LEVEL_INFO 6
#define ASL_LEVEL_DEBUG 7
Check out the description for the different log levels:
| Name | Level | Description |
|---|---|---|
| Emergency | 0 | The highest priority, usually reserved for catastrophic failures and reboot notices. |
| Alert | 1 | A serious failure in a key system. |
| Critical | 2 | A failure in a key system. |
| Error | 3 | Something has failed. |
| Warning | 4 | Something is amiss and might fail if not corrected. |
| Notice | 5 | Things of moderate interest to the user or administrator. |
| Info | 6 | The lowest priority that you would normally log, and purely informational in nature. |
| Debug | 7 | The lowest priority, and normally not logged except for messages from the kernel. |
By default on iOS the only items that are printed to the console are items up to level ASL_LEVEL_NOTICE.
And check out the best practive section in the above link:
Treat your log messages as a potentially customer-facing portion of your application, not as purely an internal debugging tool. Follow good logging practices to make your logs as useful as possible:
CJALog.h and CJALog.m to your projectFirst of all: take a look at the example project
CJALogEmergency(@"%s Emergency Log", __FUNCTION__);
CJALogAlert(@"%s Alert Log", __FUNCTION__);
CJALogCritical(@"%s Critical Log", __FUNCTION__);
CJALogError(@"%s Error Log", __FUNCTION__);
CJALogWarning(@"%s Warning Log", __FUNCTION__);
CJALogNotice(@"%s Notice Log", __FUNCTION__);
CJALogInfo(@"%s Info Log", __FUNCTION__);
CJALogDebug(@"%s Debug Log", __FUNCTION__);You can set your own log leven:
CJALogSetSharedLogLevel(ASL_LEVEL_EMERG);
By default the ASL_LEVEL_DEBUG level is set. In the release mode the min. log level is ASL_LEVEL_NOTICE.
Released under the MIT license.