Merge pull request #11076 from hqhq/hq_use_warning_in_sysinfo
use type WARN for warning
This commit is contained in:
commit
b57fba2430
1 changed files with 3 additions and 3 deletions
|
@ -20,20 +20,20 @@ func New(quiet bool) *SysInfo {
|
|||
sysInfo := &SysInfo{}
|
||||
if cgroupMemoryMountpoint, err := cgroups.FindCgroupMountpoint("memory"); err != nil {
|
||||
if !quiet {
|
||||
log.Printf("WARNING: %s\n", err)
|
||||
log.Warnf("%s", err)
|
||||
}
|
||||
} else {
|
||||
_, err1 := ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, "memory.limit_in_bytes"))
|
||||
_, err2 := ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, "memory.soft_limit_in_bytes"))
|
||||
sysInfo.MemoryLimit = err1 == nil && err2 == nil
|
||||
if !sysInfo.MemoryLimit && !quiet {
|
||||
log.Printf("WARNING: Your kernel does not support cgroup memory limit.")
|
||||
log.Warnf("Your kernel does not support cgroup memory limit.")
|
||||
}
|
||||
|
||||
_, err = ioutil.ReadFile(path.Join(cgroupMemoryMountpoint, "memory.memsw.limit_in_bytes"))
|
||||
sysInfo.SwapLimit = err == nil
|
||||
if !sysInfo.SwapLimit && !quiet {
|
||||
log.Printf("WARNING: Your kernel does not support cgroup swap limit.")
|
||||
log.Warnf("Your kernel does not support cgroup swap limit.")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue