DaveWoodCom / XCGLogger

A debug log framework for use in Swift projects. Allows you to log details to the console (and optionally a file), just like you would have with NSLog() or print(), but with additional information, such as the date, function name, filename and line number.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How Can I color with font

wfs498121294 opened this issue · comments

commented

Hello ,

I use ANSIColorLogFormatter, but it not work
let ansiColorLogFormatter = ANSIColorLogFormatter()
ansiColorLogFormatter.resetFormatting()
log.formatters = [ansiColorLogFormatter]

so I find ColoredConsole can color logger , but I do not have idea work with XXGLogger . can you help me

I use it as this

logger.debug("debug".debugColor())
logger.info("info".infoColor())

I do not know how to cofigure it

Xcode no longer supports ANSI colour in the console so ANSIColorLogFormatter isn't useful there anymore. It can be used if you're outputting your logs to a file and then watching that file in a terminal that does support ANSI colours.

The ColoredConsole project uses a custom font to display colour. I don't see why you couldn't create a custom LogFormatter that then uses ColoredConsole to colourize the text.