Conversation
|
Hello, |
|
The example uses Logging libraries provide a way to get an
The problem here is that the I also want to point out that other projects do this to allow for unification of logs, for example go-fiber: https://docs.gofiber.io/api/middleware/logger/ It's interesting that you say it's more about aligning APIs; but you don't realize that supporting |
|
Thank you for your quick reply! Do you agree that a logger created with zapLogger, _ := zap.NewDevelopment()
stdOutLogger := zap.NewStdLog(zapLogger)
zW := stdOutLogger.Writer()
logger := cron.VerbosePrintfLogger(log.New(zW, "cron: ", log.Llongfile))would behave almost the same way as the external logger you are adding? "Almost" because of the extra call to |
|
You can definitely do it that way to the same affect. If that is preferred method in |
|
I'm not a maintainer and hence I cannot make any decision. Just wanted to share my thoughts. However, I consider very interesting what you pointed out and maybe this could lead to some discussion for a potential logging API refactor proposal. |
|
Refactor is probably overkill for something like this, especially with projects that use this library. That's why this PR adds additional functionality instead of removing/changing the old. |
Hello,
This PR adds support for external loggers via
io.Writer. Sample code of it working is below:Should output something like: