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
9b632683
Commit
9b632683
authored
Dec 14, 2018
by
Sietse Ringers
Browse files
Improve verbosity configuration
parent
a5366813
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/irmaserver/cmd/main.go
View file @
9b632683
...
...
@@ -72,8 +72,7 @@ func setFlags(cmd *cobra.Command) error {
flags
.
Lookup
(
"signing"
)
.
NoOptDefVal
=
"*"
flags
.
Lookup
(
"issuing"
)
.
NoOptDefVal
=
"*"
flags
.
BoolP
(
"verbose"
,
"v"
,
false
,
"verbose"
)
flags
.
Bool
(
"vverbose"
,
false
,
"more verbose"
)
flags
.
CountP
(
"verbose"
,
"v"
,
"verbose (repeatable)"
)
flags
.
BoolP
(
"quiet"
,
"q"
,
false
,
"quiet"
)
// Environment variables
...
...
@@ -99,17 +98,19 @@ func configure() error {
err
:=
viper
.
ReadInConfig
()
// Hold error checking until we know how much of it to log
// Set log level
if
viper
.
GetBool
(
"verbose"
)
{
verbosity
:=
viper
.
GetInt
(
"verbose"
)
if
verbosity
==
1
{
logger
.
Level
=
logrus
.
DebugLevel
}
if
v
iper
.
GetBool
(
"vverbose"
)
{
if
v
erbosity
>=
2
{
logger
.
Level
=
logrus
.
TraceLevel
}
if
viper
.
GetBool
(
"quiet"
)
{
logger
.
Out
=
ioutil
.
Discard
}
logger
.
Debugf
(
"Configuring"
)
logger
.
Debug
(
"Configuring"
)
logger
.
Debug
(
"Log level "
,
logger
.
Level
.
String
())
if
err
!=
nil
{
if
_
,
notfound
:=
err
.
(
viper
.
ConfigFileNotFoundError
);
notfound
{
logger
.
Info
(
"No configuration file found"
)
...
...
@@ -133,8 +134,8 @@ func configure() error {
GlobalPermissions
:
irmaserver
.
Permissions
{},
JwtIssuer
:
viper
.
GetString
(
"jwtissuer"
),
JwtPrivateKey
:
viper
.
GetString
(
"jwtprivatekey"
),
Verbose
:
viper
.
Get
Bool
(
"verbose"
),
VVerbose
:
viper
.
GetBool
(
"
vverbose
"
),
Verbose
:
viper
.
Get
Int
(
"verbose"
),
Quiet
:
viper
.
GetBool
(
"
quiet
"
),
}
// Handle global permissions
...
...
server/irmaserver/conf.go
View file @
9b632683
...
...
@@ -32,9 +32,8 @@ type Configuration struct {
// Private key to sign result JWTs with. If absent, /result-jwt and /getproof are disabled.
JwtPrivateKey
string
`json:"jwtprivatekey" mapstructure:"jwtprivatekey"`
Verbose
bool
VVerbose
bool
Quiet
bool
Verbose
int
Quiet
bool
jwtPrivateKey
*
rsa
.
PrivateKey
}
...
...
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