lovoo / goka

Goka is a compact yet powerful distributed stream processing library for Apache Kafka written in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goka set debug mode to custom logger

MirkoGibin opened this issue · comments

commented

I am using goka.WithLogger to set a custom logger.

In goka v1.0.6 the goka.Logger interface exported the method Debugf, by which I was able to see goka debug logs.
After v1.1.0 the Debugf method is part of the unexported interface goka.logger. For this reason I cannot see goka debug logs with my custom logger.

The function goka.Debug(gokaDebug, saramaDebug bool) allows me to see the goka debug logs only if I use the default logger.
If I set my custom logger as Sarama logger with goka.SetSaramaLogger I can see Sarama debug logs.

Is there a way to activate the debug mode even if I am using a custom logger for goka?

Hi @MirkoGibin,
yep that wasn't working yet I guess. The WithLogger options use now the default logger's debug option. Also it lets you enable debug logging individually for custom loggers when global goka debug logging is actually disabled. It's implemented in the branch 382-custom-debug-log.
Could you try if that would work for you?

commented

Hi @frairon,

I confirm that the new implementation works for us.

Thank you for your fast fast intervention.

@MirkoGibin, it's fixed in v1.1.3, though without the extra bool to enable debug for custom loggers.
To enable debugging, just turn it on via goka.Debug(true, ?). It'll get inherited to all custom loggers automatically.