-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add log sub command for kmesh-daemon #459
Add log sub command for kmesh-daemon #459
Conversation
Signed-off-by: 923048992@qq.com <923048992@qq.com>
ec6cd97
to
a070972
Compare
Signed-off-by: 923048992@qq.com <923048992@qq.com>
a070972
to
d94222f
Compare
daemon/manager/log/log.go
Outdated
fmt.Println(string(body)) | ||
} | ||
|
||
func RunGetOrSetLoggerLevel(cmd *cobra.Command, args []string) error { |
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.
Is it possible to delete the error returned by this function?
Signed-off-by: 923048992@qq.com <923048992@qq.com>
daemon/manager/log/log.go
Outdated
|
||
func GetLoggerLevel(args []string) { | ||
if len(args) != 1 { | ||
fmt.Println("Missing logger name argument") |
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.
nit: if we donot know what logger it is in kmesh, should we support kmesh log shows all the logger
pkg/status/status_server.go
Outdated
@@ -71,6 +71,10 @@ func GetConfigDumpAddr(mode string) string { | |||
return "http://" + adminAddr + configDumpPrefix + "/" + mode | |||
} | |||
|
|||
func GetLoggerLevelAddr() string { |
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.
func GetLoggerLevelAddr() string { | |
func GetLoggerURL() string { |
daemon/manager/logs/logs.go
Outdated
Example: "kmesh-daemon logs", | ||
Args: cobra.NoArgs, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
_ = RunPrintLogs() |
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.
remove, Does it worth doing this?
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.
it adds a shortcut for 'cat LOG_FILE_PATH', where LOG_FILE_PATH is the logs file path, like '/var/run/kmesh/daemon.log'. For people not informed of the log path, they can type logs command to print logs.
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.
We should remove the print to files in future.
Signed-off-by: 923048992@qq.com <923048992@qq.com>
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
feature
What this PR does / why we need it:
Add log sub command for kmesh-daemon
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: