Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
b241f20d
Commit
b241f20d
authored
Feb 07, 2019
by
Sietse Ringers
Browse files
Fix log output and add missing flags to main irmad command
parent
8620d499
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/irmad/cmd/root.go
View file @
b241f20d
...
...
@@ -2,9 +2,7 @@ package cmd
import
(
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
...
...
@@ -14,6 +12,7 @@ import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/x-cray/logrus-prefixed-formatter"
)
var
logger
=
logrus
.
StandardLogger
()
...
...
@@ -37,11 +36,17 @@ var RootCommand = &cobra.Command{
}
// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the
r
ootC
m
d.
// This is called by main.main(). It only needs to happen once to the
R
ootC
omman
d.
func
Execute
()
{
logger
.
Level
=
logrus
.
InfoLevel
logger
.
SetFormatter
(
&
prefixed
.
TextFormatter
{
FullTimestamp
:
true
,
})
if
err
:=
setFlags
(
RootCommand
);
err
!=
nil
{
die
(
errors
.
WrapPrefix
(
err
,
"Failed to attach flags to "
+
RootCommand
.
Name
()
+
" command"
,
0
))
}
if
err
:=
RootCommand
.
Execute
();
err
!=
nil
{
fmt
.
Println
(
err
)
os
.
Exit
(
-
1
)
die
(
errors
.
Wrap
(
err
,
0
))
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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