UPDATE: slog is currently available in Go 1.21, and we should make the effort to migrate to use slog.
Current Behavior
meshkit uses logrus for custom logging, and we created a custom logger that only returns certain fields such as
But we're lacking on the other fields that logrus has and we're using a mixture of logrus and our custom logger.
meshkit will benefit from having more fields to call from, when utilizing the custom logging tool in meshery. This will help migrate mesheryctl to use the custom logger, instead of calling logrus directly.
For this purpose of tracking the migration, we will be migrating to use slog instead, which is slightly basic but gives us a bit more ability to customize logging and use more fields.
Here are the fields that slog currently supports
Info
InfoCtx
Warn
WarnCtx
Debug
DebugCtx
Error
ErrorCtx
There is no built-in support for formatting strings, but slog allows us to create our own fields.
Desired Behavior
Opening this issue to track the progress.
Resources
Alternatives / Additional Context
UPDATE:
slogis currently available in Go1.21, and we should make the effort to migrate to useslog.Current Behavior
meshkituseslogrusfor custom logging, and we created a custom logger that only returns certain fields such aswarninfoerrordebugBut we're lacking on the other fields that
logrushas and we're using a mixture oflogrusand our custom logger.meshkitwill benefit from having more fields to call from, when utilizing the custom logging tool inmeshery. This will help migratemesheryctlto use the custom logger, instead of callinglogrusdirectly.For this purpose of tracking the migration, we will be migrating to use
sloginstead, which is slightly basic but gives us a bit more ability to customize logging and use more fields.Here are the fields that
slogcurrently supportsInfoInfoCtxWarnWarnCtxDebugDebugCtxErrorErrorCtxThere is no built-in support for formatting strings, but
slogallows us to create our own fields.Desired Behavior
Opening this issue to track the progress.
Resources
Alternatives / Additional Context