Swift 2016-05-30 23:08
Swift 日志框架 XCGLogger
回复:0 查看:6565 感兴趣:17 赞:0
XCGLogger是一个debug日志框架,用于Swift项目中。允许您记录详细信息到控制台(还有一个可选的文件)。就像你用NSLog或println,但还有其他额处信息,如日期,函数名,文件名和行号。
示例代码:
import XCGLogger let log = XCGLogger.defaultInstance() //配置 log.setup(.Debug, showThreadName: true, showLogLevel: true, showFileNames: true, showLineNumbers: true, writeToFile: "path/to/file", fileLogLevel: .Debug) log.verbose("A verbose message, usually useful when working on a specific problem") log.debug("A debug message") log.info("An info message, probably useful to power users looking in console.app") log.warning("A warning message, may indicate a possible error") log.error("An error occurred, but it's recoverable, just info about what happened") log.severe("A severe error occurred, we are likely about to crash now")
相关开源代码
EFIconFont: 一个用 Swift 实现的 IconFont 封装
Swift Zip文件压缩与解压框架
EFResume - 一个普通的 Swift 简历模板
Swift 优雅的定时器及执行工具库 Each
Swift 解析、格式化及验证国际电话号码工具库 PhoneNumberKit
Swift 版 FlatBuffers(跨平台序列化库)FlatBuffersSwift
Swift 编写的 Github API 客户端 Github.swift
Swift OAuth授权库 SwiftyOAuth
Swift 音频处理库 TempiFFT
iOS通知中心封装库SwiftNotificationCenter