mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
don't configure log level if the item does not exist in the config
Reported here: https://github.com/gustavo-iniguez-goya/opensnitch/issues/31#issuecomment-633759613 The LogLevel conf item should always exist, but just in case.
This commit is contained in:
parent
6c9d9b28f6
commit
36a11b4102
2 changed files with 4 additions and 2 deletions
|
@ -33,7 +33,7 @@ type Config struct {
|
|||
DefaultDuration string
|
||||
InterceptUnknown bool
|
||||
ProcMonitorMethod string
|
||||
LogLevel uint32
|
||||
LogLevel *uint32
|
||||
}
|
||||
|
||||
// Client holds the connection information of a client.
|
||||
|
|
|
@ -47,7 +47,9 @@ func (c *Client) loadConfiguration(rawConfig []byte) bool {
|
|||
clientDisconnectedRule.Duration = rule.Duration(config.DefaultDuration)
|
||||
clientErrorRule.Duration = rule.Duration(config.DefaultDuration)
|
||||
}
|
||||
log.MinLevel = int(config.LogLevel)
|
||||
if config.LogLevel != nil {
|
||||
log.MinLevel = int(*config.LogLevel)
|
||||
}
|
||||
if config.ProcMonitorMethod != "" {
|
||||
procmon.MonitorMethod = config.ProcMonitorMethod
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue