@@ -24,7 +24,7 @@ import (
24
24
"github.com/google/cadvisor/info/v2"
25
25
"github.com/google/cadvisor/manager"
26
26
27
- "github.com/golang/glog "
27
+ "k8s.io/klog "
28
28
)
29
29
30
30
const (
@@ -85,7 +85,7 @@ func (self *version1_0) SupportedRequestTypes() []string {
85
85
func (self * version1_0 ) HandleRequest (requestType string , request []string , m manager.Manager , w http.ResponseWriter , r * http.Request ) error {
86
86
switch requestType {
87
87
case machineApi :
88
- glog .V (4 ).Infof ("Api - Machine" )
88
+ klog .V (4 ).Infof ("Api - Machine" )
89
89
90
90
// Get the MachineInfo
91
91
machineInfo , err := m .GetMachineInfo ()
@@ -99,7 +99,7 @@ func (self *version1_0) HandleRequest(requestType string, request []string, m ma
99
99
}
100
100
case containersApi :
101
101
containerName := getContainerName (request )
102
- glog .V (4 ).Infof ("Api - Container(%s)" , containerName )
102
+ klog .V (4 ).Infof ("Api - Container(%s)" , containerName )
103
103
104
104
// Get the query request.
105
105
query , err := getContainerInfoRequest (r .Body )
@@ -149,7 +149,7 @@ func (self *version1_1) HandleRequest(requestType string, request []string, m ma
149
149
switch requestType {
150
150
case subcontainersApi :
151
151
containerName := getContainerName (request )
152
- glog .V (4 ).Infof ("Api - Subcontainers(%s)" , containerName )
152
+ klog .V (4 ).Infof ("Api - Subcontainers(%s)" , containerName )
153
153
154
154
// Get the query request.
155
155
query , err := getContainerInfoRequest (r .Body )
@@ -198,7 +198,7 @@ func (self *version1_2) SupportedRequestTypes() []string {
198
198
func (self * version1_2 ) HandleRequest (requestType string , request []string , m manager.Manager , w http.ResponseWriter , r * http.Request ) error {
199
199
switch requestType {
200
200
case dockerApi :
201
- glog .V (4 ).Infof ("Api - Docker(%v)" , request )
201
+ klog .V (4 ).Infof ("Api - Docker(%v)" , request )
202
202
203
203
// Get the query request.
204
204
query , err := getContainerInfoRequest (r .Body )
@@ -279,7 +279,7 @@ func handleEventRequest(request []string, m manager.Manager, w http.ResponseWrit
279
279
return err
280
280
}
281
281
query .ContainerName = path .Join ("/" , getContainerName (request ))
282
- glog .V (4 ).Infof ("Api - Events(%v)" , query )
282
+ klog .V (4 ).Infof ("Api - Events(%v)" , query )
283
283
if ! stream {
284
284
pastEvents , err := m .GetPastEvents (query )
285
285
if err != nil {
@@ -319,14 +319,14 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
319
319
}
320
320
switch requestType {
321
321
case versionApi :
322
- glog .V (4 ).Infof ("Api - Version" )
322
+ klog .V (4 ).Infof ("Api - Version" )
323
323
versionInfo , err := m .GetVersionInfo ()
324
324
if err != nil {
325
325
return err
326
326
}
327
327
return writeResult (versionInfo .CadvisorVersion , w )
328
328
case attributesApi :
329
- glog .V (4 ).Info ("Api - Attributes" )
329
+ klog .V (4 ).Info ("Api - Attributes" )
330
330
331
331
machineInfo , err := m .GetMachineInfo ()
332
332
if err != nil {
@@ -339,7 +339,7 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
339
339
info := v2 .GetAttributes (machineInfo , versionInfo )
340
340
return writeResult (info , w )
341
341
case machineApi :
342
- glog .V (4 ).Info ("Api - Machine" )
342
+ klog .V (4 ).Info ("Api - Machine" )
343
343
344
344
// TODO(rjnagal): Move machineInfo from v1.
345
345
machineInfo , err := m .GetMachineInfo ()
@@ -349,7 +349,7 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
349
349
return writeResult (machineInfo , w )
350
350
case summaryApi :
351
351
containerName := getContainerName (request )
352
- glog .V (4 ).Infof ("Api - Summary for container %q, options %+v" , containerName , opt )
352
+ klog .V (4 ).Infof ("Api - Summary for container %q, options %+v" , containerName , opt )
353
353
354
354
stats , err := m .GetDerivedStats (containerName , opt )
355
355
if err != nil {
@@ -358,13 +358,13 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
358
358
return writeResult (stats , w )
359
359
case statsApi :
360
360
name := getContainerName (request )
361
- glog .V (4 ).Infof ("Api - Stats: Looking for stats for container %q, options %+v" , name , opt )
361
+ klog .V (4 ).Infof ("Api - Stats: Looking for stats for container %q, options %+v" , name , opt )
362
362
infos , err := m .GetRequestedContainersInfo (name , opt )
363
363
if err != nil {
364
364
if len (infos ) == 0 {
365
365
return err
366
366
}
367
- glog .Errorf ("Error calling GetRequestedContainersInfo: %v" , err )
367
+ klog .Errorf ("Error calling GetRequestedContainersInfo: %v" , err )
368
368
}
369
369
contStats := make (map [string ][]v2.DeprecatedContainerStats , 0 )
370
370
for name , cinfo := range infos {
@@ -373,7 +373,7 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
373
373
return writeResult (contStats , w )
374
374
case customMetricsApi :
375
375
containerName := getContainerName (request )
376
- glog .V (4 ).Infof ("Api - Custom Metrics: Looking for metrics for container %q, options %+v" , containerName , opt )
376
+ klog .V (4 ).Infof ("Api - Custom Metrics: Looking for metrics for container %q, options %+v" , containerName , opt )
377
377
infos , err := m .GetContainerInfoV2 (containerName , opt )
378
378
if err != nil {
379
379
return err
@@ -413,7 +413,7 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
413
413
return writeResult (contMetrics , w )
414
414
case specApi :
415
415
containerName := getContainerName (request )
416
- glog .V (4 ).Infof ("Api - Spec for container %q, options %+v" , containerName , opt )
416
+ klog .V (4 ).Infof ("Api - Spec for container %q, options %+v" , containerName , opt )
417
417
specs , err := m .GetContainerSpec (containerName , opt )
418
418
if err != nil {
419
419
return err
@@ -451,7 +451,7 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
451
451
// ignore recursive.
452
452
// TODO(rjnagal): consider count to limit ps output.
453
453
name := getContainerName (request )
454
- glog .V (4 ).Infof ("Api - Spec for container %q, options %+v" , name , opt )
454
+ klog .V (4 ).Infof ("Api - Spec for container %q, options %+v" , name , opt )
455
455
ps , err := m .GetProcessList (name , opt )
456
456
if err != nil {
457
457
return fmt .Errorf ("process listing failed: %v" , err )
@@ -489,24 +489,24 @@ func (self *version2_1) HandleRequest(requestType string, request []string, m ma
489
489
490
490
switch requestType {
491
491
case machineStatsApi :
492
- glog .V (4 ).Infof ("Api - MachineStats(%v)" , request )
492
+ klog .V (4 ).Infof ("Api - MachineStats(%v)" , request )
493
493
cont , err := m .GetRequestedContainersInfo ("/" , opt )
494
494
if err != nil {
495
495
if len (cont ) == 0 {
496
496
return err
497
497
}
498
- glog .Errorf ("Error calling GetRequestedContainersInfo: %v" , err )
498
+ klog .Errorf ("Error calling GetRequestedContainersInfo: %v" , err )
499
499
}
500
500
return writeResult (v2 .MachineStatsFromV1 (cont ["/" ]), w )
501
501
case statsApi :
502
502
name := getContainerName (request )
503
- glog .V (4 ).Infof ("Api - Stats: Looking for stats for container %q, options %+v" , name , opt )
503
+ klog .V (4 ).Infof ("Api - Stats: Looking for stats for container %q, options %+v" , name , opt )
504
504
conts , err := m .GetRequestedContainersInfo (name , opt )
505
505
if err != nil {
506
506
if len (conts ) == 0 {
507
507
return err
508
508
}
509
- glog .Errorf ("Error calling GetRequestedContainersInfo: %v" , err )
509
+ klog .Errorf ("Error calling GetRequestedContainersInfo: %v" , err )
510
510
}
511
511
contStats := make (map [string ]v2.ContainerInfo , len (conts ))
512
512
for name , cont := range conts {
0 commit comments