ColoredConsole icon indicating copy to clipboard operation
ColoredConsole copied to clipboard

Using with XCGLogger

Open b-onc opened this issue 4 years ago • 3 comments

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

b-onc avatar Aug 26 '19 06:08 b-onc

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

Sherlouk avatar Aug 26 '19 13:08 Sherlouk

@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

jjrscott avatar Sep 07 '19 21:09 jjrscott

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?

b-onc avatar Sep 09 '19 06:09 b-onc