-
大小: 759KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-06-11
- 语言: Java
- 标签: iOS Lumberjack java
资源简介
CocoaLumberjack是iOS平台著名的日志框架,demo完整展示了这个框架的使用,并且包含 接收日志的后台java代码!CocoaLumberjack是iOS平台著名的日志框架,demo完整展示了这个框架的使用,并且包含 接收日志的后台java代码!CocoaLumberjack是iOS平台著名的日志框架,demo完整展示了这个框架的使用,并且包含 接收日志的后台java代码!
代码片段和文件信息
//
// AppDelegate.m
// CocoaLumberjack
//
// Created by liguobin on 2017/8/31.
// Copyright © 2017年 apple. All rights reserved.
//
#import “AppDelegate.h“
#import “ViewController.h“
#import “CustomLogFileManager.h“
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self configCocoaLumberJack];
[UIApplication sharedApplication].idleTimerDisabled = YES;
_window = [[UIWindow alloc] initWithframe:[UIScreen mainScreen].bounds];
_window.backgroundColor = [UIColor whiteColor];
[_window makeKeyAndVisible];
ViewController* mainController = [[ViewController alloc] init];
[_window setRootViewController:mainController];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks disable timers and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources save user data invalidate timers and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
-(void)configCocoaLumberJack{
[self createFileDirectories];
//开始时,你需要下面两行代码:
[DDLog addLogger:[DDASLLogger sharedInstance]];
[DDLog addLogger:[DDTTYLogger sharedInstance]];
//这将在你的日志框架中添加两个“logger”。也就是说你的日志语句将被发送到Console.app和Xcode控制 台(就像标准的NSLog)
//这个框架的好处之一就是它的灵活性,如果你还想要你的日志语句写入到一个文件中,你可以添加和配置一个file logger:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory NSUserDomainMask YES);
NSString *docDir = [paths objectAtIndex:0];
NSString *logpath= [docDir stringByAppendingPathComponent:@“DDLog“];
//自定义日志文件路径
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-09-04 14:12 CocoaLumberjackServer\
文件 6148 2017-09-04 17:37 CocoaLumberjackServer\.DS_Store
目录 0 2017-09-09 11:20 __MACOSX\
目录 0 2017-09-09 11:20 __MACOSX\CocoaLumberjackServer\
文件 120 2017-09-04 17:37 __MACOSX\CocoaLumberjackServer\._.DS_Store
目录 0 2017-08-31 17:13 CocoaLumberjackServer\CocoaLumberjack\
目录 0 2017-09-04 14:21 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\
文件 282 2017-08-31 17:10 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\AppDelegate.h
目录 0 2017-09-09 11:20 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\
目录 0 2017-09-09 11:20 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\
文件 171 2017-08-31 17:10 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\._AppDelegate.h
文件 4691 2017-09-04 14:21 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\AppDelegate.m
文件 808 2017-09-04 14:21 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\._AppDelegate.m
目录 0 2017-08-31 17:16 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\Assets.xcassets\
目录 0 2017-08-31 17:16 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\Assets.xcassets\AppIcon.appiconset\
文件 1495 2017-08-31 17:16 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\Assets.xcassets\AppIcon.appiconset\Contents.json
目录 0 2017-08-31 17:10 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\ba
文件 1740 2017-08-31 17:10 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\ba
目录 0 2017-09-09 11:20 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\ba
文件 171 2017-08-31 17:10 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\ba
文件 1689 2017-08-31 17:10 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\ba
文件 171 2017-08-31 17:10 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\ba
文件 1033 2017-09-04 14:21 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\CocoaLumberjack.pch
文件 482 2017-09-04 14:21 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\._CocoaLumberjack.pch
文件 237 2017-09-04 14:21 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\Consts.h
文件 344 2017-09-04 14:21 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\._Consts.h
文件 218 2017-09-04 14:21 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\Consts.m
文件 328 2017-09-04 14:21 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\._Consts.m
文件 346 2017-09-01 17:44 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\CustomLogFileManager.h
文件 344 2017-09-01 17:44 __MACOSX\CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\._CustomLogFileManager.h
文件 783 2017-09-01 17:44 CocoaLumberjackServer\CocoaLumberjack\CocoaLumberjack\CustomLogFileManager.m
............此处省略254个文件信息
相关资源
- javaSwing万年历小程序
- java编程思想(第四版)书中源码及习
- LZW实现Java压缩解压
- java实现数据的备份与恢复jar包
- java3D显示一个球的代码
- 利用Java3D1.4制成的动态爬山算法
- Activiti7视频教程Java通用型工作流开发
- 基于Java的课堂随机点名器
- 基于Java的课堂_随机点名器
- 使用java实现的Bezier曲线
- java + sql 银行管理系统
- QR分解的Java实现
- ISM解释结构模型算法的JAVA
- Java+ajax写的登录
- Java多人聊天室(有登录注册)
- 根据配置文件自动构造Bean类
- 基于java-web的图书管理系统带源码
- 大文件上传的javawebuploader包括前台和
- Java-保存计算过程的计算器
- SpringBoot集成Elasticsearch已实现各种ES操
- java 抽奖系统jar 完整版
- JSP 和 JavaBean连接sql server验证登录
- 基于JAVA的小区物业管理系统 论文
- eclipse 4.7 oxy folding 代码折叠 com.cb.ec
- 用eclipse写的贪吃蛇(java)
- java统计正文中关键字个数
- Javaweb版的图书管理系统
- java-client-1.2.1.jar
- Quartz动态修改时间,java实现修改Cro
- 文件加密解密算法(Java源码)
评论
共有 条评论