Code Monkey home page Code Monkey logo

ios-zy-loggingcocoalumberjack's Introduction

ZYLoggingCocoaLumberjack

ZYLoggingAPI实现,对CocoaLumberjack封装

CocoaPods 安装

pod ZYLoggingCocoaLumberjack

要求

  • ARC支持
  • iOS 5.0+

使用方法

使用前请确认 ZYLogger 文件中 ddLogLevel 参数定义是否正确,定义日志级别。上层依赖日志调用依赖于ZYLoggingAPI

配置CocoaLumberjack

1、程序启动处添加配置
-(BOOL)application:application didFinishLaunchingWithOptions:launchOptions

/**
* 添加Xcode控制台日志记录器
*/
[DDLog addLogger:[DDTTYLogger sharedInstance] withLevel:DDLogLevelAll];
/**
* 添加苹果后台日志记录器
*/
[DDLog addLogger:[DDASLLogger sharedInstance] withLevel:DDLogLevelAll];
/**
* 让控制台日志支持颜色显示(需先安装XcodeColors插件,并配置)
*/
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];


2、根据需求修改ZYLogger.h文件中的全局日志级别,下面是默认配置,可根据自己需求修改

#ifdef DEBUG
static const DDLogLevel ddLogLevel = DDLogLevelAll;
#else
static const DDLogLevel ddLogLevel = DDLogLevelError;
#endif

配置XcodeColor插件

1、先安装插件XcodeColor 2、工程中 "Edit Scheme" -> "Run" -> "Arguments" -> "Environment Variables" 添加key:XcodeColors value:YES

ios-zy-loggingcocoalumberjack's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.