Improve logging.

pull/6/head
Daniel Smith 2014-07-01 14:01:42 -07:00
parent 50bbf39925
commit b820e026f6
2 changed files with 7 additions and 6 deletions

View File

@ -102,6 +102,7 @@ func runReplicationControllerTest(kubeClient *client.Client) {
if err != nil || len(pods.Items) != controllerRequest.DesiredState.Replicas { if err != nil || len(pods.Items) != controllerRequest.DesiredState.Replicas {
glog.Fatalf("FAILED: %#v", pods.Items) glog.Fatalf("FAILED: %#v", pods.Items)
} }
glog.Infof("Replication controller produced:\n\n%#v\n\n", pods)
} }
func main() { func main() {

View File

@ -643,14 +643,14 @@ func (kl *Kubelet) syncManifest(manifest *api.ContainerManifest, keepChannel cha
// Make sure we have a network container // Make sure we have a network container
netId, err := kl.getNetworkContainerId(manifest) netId, err := kl.getNetworkContainerId(manifest)
if err != nil { if err != nil {
glog.Errorf("Failed to introspect network container. (%v) Skipping container %s", err, manifest.ID) glog.Errorf("Failed to introspect network container. (%v) Skipping manifest %s", err, manifest.ID)
return err return err
} }
if netId == "" { if netId == "" {
glog.Infof("Network container doesn't exist, creating") glog.Infof("Network container doesn't exist, creating")
netId, err = kl.createNetworkContainer(manifest) netId, err = kl.createNetworkContainer(manifest)
if err != nil { if err != nil {
glog.Errorf("Failed to introspect network container. (%v) Skipping container %s", err, manifest.ID) glog.Errorf("Failed to introspect network container. (%v) Skipping manifest %s", err, manifest.ID)
return err return err
} }
} }
@ -658,24 +658,24 @@ func (kl *Kubelet) syncManifest(manifest *api.ContainerManifest, keepChannel cha
for _, container := range manifest.Containers { for _, container := range manifest.Containers {
containerId, err := kl.getContainerId(manifest, &container) containerId, err := kl.getContainerId(manifest, &container)
if err != nil { if err != nil {
glog.Errorf("Error finding container: %v skipping id %s.", err, manifest.ID) glog.Errorf("Error finding container: %v skipping manifest %s container %s.", err, manifest.ID, container.Name)
continue continue
} }
if containerId == "" { if containerId == "" {
glog.Infof("%+v doesn't exist, creating", container) glog.Infof("%+v doesn't exist, creating", container)
kl.DockerPuller.Pull(container.Image) kl.DockerPuller.Pull(container.Image)
if err != nil { if err != nil {
glog.Errorf("Failed to create container: %v Skipping container %s", err, manifest.ID) glog.Errorf("Failed to create container: %v skipping manifest %s container %s.", err, manifest.ID, container.Name)
continue continue
} }
containerId, err = kl.runContainer(manifest, &container, "container:"+string(netId)) containerId, err = kl.runContainer(manifest, &container, "container:"+string(netId))
if err != nil { if err != nil {
// TODO(bburns) : Perhaps blacklist a container after N failures? // TODO(bburns) : Perhaps blacklist a container after N failures?
glog.Errorf("Error running container: %v skipping.", err) glog.Errorf("Error running manifest %s container %s: %v", manifest.ID, container.Name, err)
continue continue
} }
} else { } else {
glog.V(1).Infof("%s exists as %v", container.Name, containerId) glog.V(1).Infof("manifest %s container %s exists as %v", manifest.ID, container.Name, containerId)
} }
keepChannel <- containerId keepChannel <- containerId
} }