ZHLog is a printing tools for iOS, Simple, quick, convenient!
- Support to print information in Debug mode, not print in Release mode.
- Support printing method name, line.
- Supports print byte stream.
- The support log is saved to the local and can be exported.
- Support printing information classification: warning, error, debug information, important information, etc.
- Logs are saved by the day, automatically deleted a month ago.
- Support for manual cleanup log.
- Support for secondary development.
- iOS 7.0+
- ARC
CocoaPods (recommended)
pod 'ZHLog'
import <ZHLog/ZHShareLog.h>
ZHLog(@"zhlog"); //The print information
ZHLogDebug(@"debug"); //debug the information, along with the name of the function, the line, and so on.
ZHLogInfo(@"Info");//Print the information, along with the name of the function, the line, and so on.
ZHLogImportant(@"Important");//Print important information, along with the name of the function, the line and so on.
ZHLogError(@"error");//Print the error message, along with the name of the function, the line, and so on.
ZHLogWarning(@"warning");//Print the warning message, along with the name of the function, the line, and so on.
ZHLogToFile(@"tofile", ZH_Log_Info);//Print the information, attach the name of the function, the line, and so on, and save it to the log.
[[ZHShareLog shareZHShareLog]printDebugInfo:@"Info" withLevel:ZH_Log_Error];//Print different types of information.
typedef NS_ENUM(NSInteger,ZH_Log_Level)
{
ZH_Log_Error = 0,
ZH_Log_Info = 1,
ZH_Log_Warning = 2,
ZH_Log_Debug = 3,
ZH_Log_Important = 4,
ZH_Log_Verblose = 5,
};
-(void)clearAllLogFile;
-(void)clearMonthAgoLogFile;
-(void)clearTodayLog;
-(void)printLogWithBuffer:(Byte *)buffer andLength:(NSUInteger)length andLabel:(NSString *)flagStr;
2018-04-21 11:42:03.260219+0800 ZHLog[75592:3057889] zhlog
2018-04-21 11:42:03.260355+0800 ZHLog[75592:3057889] ✅Debug: -[ViewController viewDidLoad] [Line 26] debug
2018-04-21 11:42:03.260438+0800 ZHLog[75592:3057889] 💧Info: -[ViewController viewDidLoad] [Line 27] Info
2018-04-21 11:42:03.260523+0800 ZHLog[75592:3057889] ❗️Important: -[ViewController viewDidLoad] [Line 28] Important
2018-04-21 11:42:03.260620+0800 ZHLog[75592:3057889] ❌Error: -[ViewController viewDidLoad] [Line 29] error
2018-04-21 11:42:03.260725+0800 ZHLog[75592:3057889] ⚠️Warning: -[ViewController viewDidLoad] [Line 30] warning
2018-04-21 11:42:03.260800+0800 ZHLog[75592:3057889] ✅Debug: -[ViewController viewDidLoad] [Line 33] tofile debug
2018-04-21 11:42:03.265322+0800 ZHLog[75592:3057889] 💧Info: -[ViewController viewDidLoad] [Line 34] tofile info
2018-04-21 11:42:03.265828+0800 ZHLog[75592:3057889] ⚠️Warning: -[ViewController viewDidLoad] [Line 35] tofile warning
2018-04-21 11:42:03.266318+0800 ZHLog[75592:3057889] ❌Error: -[ViewController viewDidLoad] [Line 36] tofile error
2018-04-21 11:42:03.266805+0800 ZHLog[75592:3057889] 💧Info: -[ViewController viewDidLoad] [Line 37] tofile important
2018-04-21 11:42:03.267331+0800 ZHLog[75592:3057889] ✅Debug: -[ViewController viewDidLoad] [Line 33] tofile debug
2018-04-21 11:38:06:✅Debug: -[ViewController viewDidLoad] [Line 33] tofile debug
2018-04-21 11:38:06:💧Info: -[ViewController viewDidLoad] [Line 34] tofile info
2018-04-21 11:38:06:⚠️Warning: -[ViewController viewDidLoad] [Line 35] tofile warning
2018-04-21 11:38:06:❌Error: -[ViewController viewDidLoad] [Line 36] tofile error
2018-04-21 11:38:06:❗️Important: -[ViewController viewDidLoad] [Line 37] tofile important
2018-04-21 11:38:06:✅Debug: -[ViewController viewDidLoad] [Line 33] tofile debug
2018-04-21 11:38:06:💧Info: -[ViewController viewDidLoad] [Line 34] tofile info
2018-04-21 11:38:06:⚠️Warning: -[ViewController viewDidLoad] [Line 35] tofile warning
2018-04-21 11:38:06:❌Error: -[ViewController viewDidLoad] [Line 36] tofile error
2018-04-21 11:38:06:❗️Important: -[ViewController viewDidLoad] [Line 37] tofile important