Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
48ffed38
Unverified
Commit
48ffed38
authored
Jan 12, 2022
by
Derek Nola
Committed by
GitHub
Jan 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable logging on all subcommands (#4921)
Signed-off-by:
Derek Nola
<
derek.nola@suse.com
>
parent
a0cadcd3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
16 deletions
+6
-16
agent.go
pkg/cli/cmds/agent.go
+1
-1
log.go
pkg/cli/cmds/log.go
+4
-0
root.go
pkg/cli/cmds/root.go
+0
-14
server.go
pkg/cli/cmds/server.go
+1
-1
No files found.
pkg/cli/cmds/agent.go
View file @
48ffed38
...
...
@@ -214,7 +214,7 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
Name
:
"agent"
,
Usage
:
"Run node agent"
,
UsageText
:
appName
+
" agent [OPTIONS]"
,
Before
:
SetupDebug
(
CheckSELinuxFlags
)
,
Before
:
CheckSELinuxFlags
,
Action
:
action
,
Flags
:
[]
cli
.
Flag
{
ConfigFlag
,
...
...
pkg/cli/cmds/log.go
View file @
48ffed38
...
...
@@ -7,6 +7,7 @@ import (
"sync"
"time"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
...
...
@@ -76,4 +77,7 @@ func setupLogging() {
flag
.
Set
(
"vmodule"
,
LogConfig
.
VModule
)
flag
.
Set
(
"alsologtostderr"
,
strconv
.
FormatBool
(
Debug
))
flag
.
Set
(
"logtostderr"
,
strconv
.
FormatBool
(
!
Debug
))
if
Debug
{
logrus
.
SetLevel
(
logrus
.
DebugLevel
)
}
}
pkg/cli/cmds/root.go
View file @
48ffed38
...
...
@@ -6,7 +6,6 @@ import (
"runtime"
"github.com/rancher/k3s/pkg/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
...
...
@@ -43,19 +42,6 @@ func NewApp() *cli.App {
Usage
:
"(data) Folder to hold state default /var/lib/rancher/"
+
version
.
Program
+
" or ${HOME}/.rancher/"
+
version
.
Program
+
" if not root"
,
},
}
app
.
Before
=
SetupDebug
(
nil
)
return
app
}
func
SetupDebug
(
next
func
(
ctx
*
cli
.
Context
)
error
)
func
(
ctx
*
cli
.
Context
)
error
{
return
func
(
ctx
*
cli
.
Context
)
error
{
if
Debug
{
logrus
.
SetLevel
(
logrus
.
DebugLevel
)
}
if
next
!=
nil
{
return
next
(
ctx
)
}
return
nil
}
}
pkg/cli/cmds/server.go
View file @
48ffed38
...
...
@@ -514,7 +514,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Name
:
"server"
,
Usage
:
"Run management server"
,
UsageText
:
appName
+
" server [OPTIONS]"
,
Before
:
SetupDebug
(
CheckSELinuxFlags
)
,
Before
:
CheckSELinuxFlags
,
Action
:
action
,
Flags
:
ServerFlags
,
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment