Closed CyrusNG closed 8 years ago
you need to be a little bit more specific, does it highlight the text?
I mean AppDelegate.m:90 is NOT a link. It can NOT clickable.
are you sure the plugin is loaded? did you have to click allow plugin?
Hi, it doesn't work for me also. I installed the Plugin via Alcatraz. I use with Xcode Version 7.1.1 (7B1005) and CocoaLumberjack. I can see the Log messages in the console but they aren't clickable.
Can you assist pleas?
My Code:
import Foundation import CocoaLumberjack import CocoaLumberjack.DDDispatchQueueLogFormatter
class MyLogger {
class func initializLogger(logLevel: DDLogLevel = .Debug){
#if DEBUG
defaultDebugLevel = logLevel
#else
defaultDebugLevel = .Off
#endif
DDLog.addLogger(DDASLLogger.sharedInstance()) //Logger for the Apple system log facility
DDLog.addLogger(DDTTYLogger.sharedInstance()) //Logger for Terminal output/Xcode console
DDTTYLogger.sharedInstance().colorsEnabled = true
DDTTYLogger.sharedInstance().setForegroundColor(UIColor.greenColor(), backgroundColor: nil, forFlag: .Info)
DDTTYLogger.sharedInstance().setForegroundColor(UIColor.magentaColor(), backgroundColor: nil, forFlag: .Debug)
DDTTYLogger.sharedInstance().logFormatter = KZFormatter()
}
}
class KZFormatter: DDDispatchQueueLogFormatter {
lazy var formatter: NSDateFormatter = { let dateFormatter = NSDateFormatter() dateFormatter.formatterBehavior = .Behavior10_4 dateFormatter.dateFormat = "HH:mm:ss.SSS" return dateFormatter }()
override func formatLogMessage(logMessage: DDLogMessage!) -> String { let dateAndTime = formatter.stringFromDate(logMessage.timestamp)
var logLevel: String
let logFlag = logMessage.flag
if logFlag.contains(.Error) {
logLevel = "ERR"
} else if logFlag.contains(.Warning){
logLevel = "WRN"
} else if logFlag.contains(.Info) {
logLevel = "INF"
} else if logFlag.contains(.Debug) {
logLevel = "DBG"
} else if logFlag.contains(.Verbose) {
logLevel = "VRB"
} else {
logLevel = "???"
}
let formattedLog = "\(dateAndTime) |\(logLevel)| \((logMessage.file as NSString).lastPathComponent):\(logMessage.line): ( \(logMessage.function) ): \(logMessage.message)"
return formattedLog;
} }
How can I check if the plugin is allow? I loaded the bundle after reset the Xcode!
I also wanna know how I can check the plugin is allow. And, I also installed the Plugin via Alcatraz. please help.
When you remove the plugin and then reinstall it, xcode should ask if you allow to load the package. Can you try reinstalling?
Tried and click "load bundle", but still not work.
Ok, After reinstall works great for a device, but doesn't work for a simulator.
@GuyKahlon can you run it from xcode and see where is it not going through on simulator for you ? something in KZLinkedConsole.swift or NSTextStorage+Extensions must be failing if you are not getting highlighted links
Checking...
If I don't use lastPathComponent, how can I get file name?
I've updated the plugin, try reinstalling and see if it works now?
It's ok now. This plugin is very cool, it can help me debug easier. Thanks.
awesome ;)
@krzysztofzablocki Thanks for this awesome plugin.
happy I was able to solve the issue for you guys :)
I rewrite one formatter to make the specific format the plugin need with CocoaLumberjack , but not work. my xCode is 6.4 and 7.1.1 with xCodeColor plugin. Log Detail: 2015-12-09 16:28:28:963 [WARN] | AppDelegate.m:90: [application:didFinishLaunchingWithOptions:]: Testing!!!!!!!!!!!!