jjrscott / ColoredConsole

Reenabling colors in Xcode's console
Other
215 stars 11 forks source link

Using with XCGLogger #1

Open b-onc opened 5 years ago

b-onc commented 5 years ago

Is it possible to use this with XCGLogger, and if so how can we do it?

Sherlouk commented 5 years ago

You can take a look at this implementation included in XCGLogger about how to introduce a "Log Formatter".

At this point you can use log.destination(withIdentifier: XCGLogger.Constants. baseConsoleDestinationIdentifier) in order to get the destination, and append your new formatter to the formatters array.

This is documented in their README

jjrscott commented 5 years ago

@b-onc, did you have any luck with this? I don’t want to step on your toes if you’ve already got an implementation read to submit to XCGLogger

b-onc commented 5 years ago

Hello @jjrscott Yes, I've implemented a quick and dirty solution to myself, it was pretty straightforward. However, I couldn't find a way to programmatically access XCode's console font so that I can warn the user to change the font (or change it programmatically)

I aim to PR it today if that works for you?