mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-01 19:28:05 +08:00
perf: adjust the log level of the rbd-node component part (#1696)
This commit is contained in:
parent
8644fcc95a
commit
128065c88b
@ -38,6 +38,7 @@ const (
|
||||
CONTAINER_ACTION_DIE = "die"
|
||||
)
|
||||
|
||||
//ContainerDesc -
|
||||
type ContainerDesc struct {
|
||||
ContainerRuntime string
|
||||
// Info is extra information of the Container. The key could be arbitrary string, and
|
||||
@ -50,21 +51,23 @@ type ContainerDesc struct {
|
||||
*types.ContainerJSON
|
||||
}
|
||||
|
||||
//GetLogPath -
|
||||
func (c *ContainerDesc) GetLogPath() string {
|
||||
if c.ContainerRuntime == ContainerRuntimeDocker {
|
||||
logrus.Infof("docker container log path %s", c.ContainerJSON.LogPath)
|
||||
logrus.Debugf("docker container log path %s", c.ContainerJSON.LogPath)
|
||||
return c.ContainerJSON.LogPath
|
||||
}
|
||||
logrus.Infof("containerd container log path %s", c.ContainerStatus.GetLogPath())
|
||||
logrus.Debugf("containerd container log path %s", c.ContainerStatus.GetLogPath())
|
||||
return c.ContainerStatus.GetLogPath()
|
||||
}
|
||||
|
||||
//GetId -
|
||||
func (c *ContainerDesc) GetId() string {
|
||||
if c.ContainerRuntime == ContainerRuntimeDocker {
|
||||
logrus.Infof("docker container id %s", c.ContainerJSON.ID)
|
||||
logrus.Debugf("docker container id %s", c.ContainerJSON.ID)
|
||||
return c.ContainerJSON.ID
|
||||
}
|
||||
logrus.Infof("containerd container id %s", c.ContainerStatus.GetId())
|
||||
logrus.Debugf("containerd container id %s", c.ContainerStatus.GetId())
|
||||
return c.ContainerStatus.GetId()
|
||||
}
|
||||
|
||||
@ -110,6 +113,7 @@ type ContainerEvent struct {
|
||||
Container *ContainerDesc
|
||||
}
|
||||
|
||||
//CacheContainer cache container
|
||||
func CacheContainer(cchan chan ContainerEvent, cs ...ContainerEvent) {
|
||||
for _, container := range cs {
|
||||
logrus.Debugf("found a container %s %s", container.Container.GetMetadata().GetName(), container.Action)
|
||||
|
@ -243,7 +243,7 @@ func getFinalRate(cpu bool, value string, capCPU, capMemMB string) (result strin
|
||||
|
||||
u, err := strconv.Atoi(value)
|
||||
if err != nil {
|
||||
logrus.Infof("err occurred details:%s", err.Error())
|
||||
logrus.Errorf("err occurred details:%s", err.Error())
|
||||
}
|
||||
|
||||
result = strconv.Itoa(u * 100 / (capMemMBInt))
|
||||
|
@ -90,7 +90,7 @@ func (u *UDPServer) UpdateEndpoints(endpoints ...*config.Endpoint) {
|
||||
logrus.Error(err)
|
||||
continue
|
||||
}
|
||||
logrus.Infof("Update event server address is %s", u.eventServerEndpoint[i])
|
||||
logrus.Debugf("Update event server address is %s", u.eventServerEndpoint[i])
|
||||
u.client = conn
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user