Skip to content

Commit

Permalink
quieter logs
Browse files Browse the repository at this point in the history
  • Loading branch information
amnonbc committed Jul 3, 2022
1 parent ef85fca commit f34be2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion under.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ func (a *app) doIt() {
log.Fatalln(err)
}
freeMem := memory.FreeMemory()
log.Println("freeMem", humanize.Bytes(freeMem), "load", la)
if freeMem < a.minFreeBytes {
log.Println("freeMem", humanize.Bytes(freeMem), "load", la)
log.Println("free memory is below", humanize.Bytes(a.minFreeBytes))
a.mustSetSecurityLevel("under_attack")
return
Expand All @@ -165,6 +165,7 @@ func (a *app) doIt() {
}

if la[0] >= a.maxLoad {
log.Println("freeMem", humanize.Bytes(freeMem), "load", la)
log.Println("Load average is", la, "setting level to under_attack")
a.mustSetSecurityLevel("under_attack")
return
Expand Down

0 comments on commit f34be2b

Please # to comment.