forked from hyperhq/runv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.go
40 lines (33 loc) · 757 Bytes
/
log.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package hypervisor
import (
"github.com/hyperhq/hypercontainer-utils/hlog"
)
const (
ERROR = hlog.ERROR
WARNING = hlog.WARNING
INFO = hlog.INFO
DEBUG = hlog.DEBUG
TRACE = hlog.TRACE
EXTRA = hlog.EXTRA
)
func (ctx *VmContext) LogLevel(level hlog.LogLevel) bool {
return hlog.IsLogLevel(level)
}
func (ctx *VmContext) LogPrefix() string {
if ctx == nil {
return "SB[] "
}
return ctx.logPrefix
}
func (ctx *VmContext) Log(level hlog.LogLevel, args ...interface{}) {
hlog.HLog(level, ctx, 1, args...)
}
func (cc *ContainerContext) LogPrefix() string {
if cc == nil {
return "SB[] Con[] "
}
return cc.logPrefix
}
func (cc *ContainerContext) Log(level hlog.LogLevel, args ...interface{}) {
hlog.HLog(level, cc, 1, args...)
}