Common logging for Stork core and hook
The hook library uses the standard logging library, unlike the Stork server. We should consider unifying the logging between all the components in the Stork code.
I implemented this hook, keeping in mind the hooks are dedicated to being implemented by external users. They may not be familiar with the Stork-specific toolset, so I tried to avoid using the external packages and prefer the functions from the standard library. Therefore, I used errors
instead of pkgerrors
and logs
instead of logrus
.
Anyway, having consistent logging between hooks and core would be valuable. However, I think we should not be forced to include logrus
in hooks.
I propose to specify the interface for the logger that would be passed to the hook. The interface might be the same as the slog
logger from the standard library. This solution would have some advantages. I'd allow us to specify the common field for all messages from a given hook, and the users would have the same experience that they know from the standard library.
Another option is just migrating from logrus
to native logging libraries (log
or rather slog
) in the Stork server and agent.