cocoalumberjack-swift

Global import for Swift CocoaLumberjack

放肆的年华 提交于 2019-12-25 08:19:55
问题 I configured CocoaLumberjack properly using the swift pod. And I can log whatever: DDLogVervose("") DDLogInfo("") But I have to in every class to use it: import CocoaLumberjack Isnt there a way that I can globaly import ? 回答1: The only "trick" to have it available in all your classes is to use a pch (precompiled header) and import CocoaLumberjack there. It's a header that gets imported in all your files. 来源: https://stackoverflow.com/questions/40568997/global-import-for-swift-cocoalumberjack

Using CocoaLumberjack in Swift command line tool throws runtime error: dyld: Library not loaded: @rpath/libswiftAppKit.dylib

这一生的挚爱 提交于 2019-12-12 03:48:46
问题 I have a command line tool written in Swift. I use Lumberjack in other, related apps, so I would like to get it working in this one. The command line tool does not import AppKit. According to the DDTTYLogger.h file, if DD_CLI is defined, custom color defs. (CLIColor.h/m) are imported, rather than AppKit/NSColor.h, so it seems that I shouldn't be getting the error. So far, I have tried adding –DDD_CLI to the Swift Compiler, Other Swift Flags. I also tried adding CLIColor.m to the build. I am

cocoalumberjack log to one file

痞子三分冷 提交于 2019-12-08 13:11:27
问题 I am developing mac application in that application I need to log to folder, where already some other application is also logging,so need to create only one file in that folder, when file rolling occurs the whole contents in that log folder are deleting .this code I am using .I don't want delete contents in log folder and is it possible to use only file with constant name .Please help me. // Configure CocoaLumberjack DDLog.addLogger(DDASLLogger.sharedInstance()) DDLog.addLogger(DDTTYLogger