-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance log format using zapr logger. #195
Conversation
Signed-off-by: morvencao <[email protected]>
625e24a
to
6f47e44
Compare
/assign @qiujian16 @clyang82 @skeeey |
@@ -24,18 +23,17 @@ func NewMigrationCommand() *cobra.Command { | |||
} | |||
|
|||
dbConfig.AddFlags(cmd.PersistentFlags()) | |||
cmd.PersistentFlags().AddGoFlagSet(flag.CommandLine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you remove it? We do not need it anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flags is added into root command, so that all sub comands can share it.
flags.SetNormalizeFunc(utilflag.WordSepNormalizeFunc) | ||
flags.AddGoFlagSet(flag.CommandLine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is to configure the logs if you remove it in agent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flags are added into the root command, we can still configure them when we run sub command(maestro migrate/server/agent).
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ref: https://issues.redhat.com/browse/ACM-14209
This PR introduces the following changes:
glog
withklog
Note: Maestro still indirectly depends on
glog
due to the current dependencies ongithub.com/openshift-online/ocm-sdk-go
andgithub.com/openshift-online/ocm-common
, which useglog
.klog
to usezapr
as the backing logger.This setup enables enhanced logging features, including detailed timestamps and structured log output (e.g.,
JSON
format).Before this PR:
After this PR: