Closed IamAlchemist closed 8 years ago
Hmmm, just taking a glance at the code you've supplied, it looks like you're doing everything correctly.
Can you verify that XcodeColors is installed correctly & enabled? (If you don't pass your own ColorTable
, do you get the expected default colorized output?)
Also, if you wouldn't mind letting me take a look at the HulkColorTable
implementation, perhaps I can help. If that's OK with you, I'll reach out via e-mail.
@emaloney Thank you a lot for replying
This is the implement of HulkColorTable
struct HulkColorTable : ColorTable {
func foregroundColorForSeverity(severity: LogSeverity) -> Color? {
switch severity {
case .Verbose:
return Color(r: 64, g: 64, b: 64)
case .Debug:
return Color(r: 128, g: 128, b: 128)
case .Info:
return Color(r: 0, g: 184, b: 254)
case .Warning:
return Color(r: 214, g: 134, b: 47)
case .Error:
return Color(r: 185, g: 81, b: 46)
}
}
}
Although I set configuration with this HulkColorTable, the console still show the error message with the color of (255,0,0)
please email me if needed.
thanks a lot
The same problem here. It just ignores colors from ColorTable =\ But I have different setup code
let config = XcodeLogConfiguration(minimumSeverity: .Verbose, debugMode: true, verboseDebugMode: true, logToASL: false, colorizer: XcodeColorsTextColorizer(), colorTable: LoggerColorTable(), filters: [], formatter: XcodeLogFormatter())
Log.enable(configuration: config)
Thanks a lot for finding the source of this bug, @IamAlchemist.
I have not merged in your PR since I've applied your fix manually (at least to master as of this moment).
I plan to do some more Swift 2.3 / Swift 3.0 work next week and hope to roll the fix out to all branches then.
In the meantime, I'll keep your PR open until you can confirm that the fix on master works as expected for you.
I appreciate you digging in to this. If you have a Twitter handle and let me know what it is, I'll give you a shout-out there, too.
P.S. I should add that the fix is available in CleanroomLogger 2.1.1.
An update: Your fix is also now available on the swift2.3
and swift3
branches. Thanks again!
CleanroomLogger really great, but i wan't to know how to change the color of logs in XcodeColor According to the document, ColorTable Should be override.
Could anybody give me an example to set it?
the following is my way to override the ColorTable but never worked