| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package cloudlogging | 5 package cloudlogging |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "flag" | 9 "flag" |
| 10 "fmt" | 10 "fmt" |
| 11 "net/http" | 11 "net/http" |
| 12 "os" | 12 "os" |
| 13 | 13 |
| 14 "cloud.google.com/go/compute/metadata" |
| 14 cloudlog "google.golang.org/api/logging/v1beta3" | 15 cloudlog "google.golang.org/api/logging/v1beta3" |
| 15 "google.golang.org/cloud/compute/metadata" | |
| 16 ) | 16 ) |
| 17 | 17 |
| 18 // DefaultResourceType is used by NewClient if ClientOptions doesn't specify | 18 // DefaultResourceType is used by NewClient if ClientOptions doesn't specify |
| 19 // ResourceType. | 19 // ResourceType. |
| 20 const ( | 20 const ( |
| 21 // GCEService is service name for GCE instances. | 21 // GCEService is service name for GCE instances. |
| 22 GCEService = "compute.googleapis.com" | 22 GCEService = "compute.googleapis.com" |
| 23 | 23 |
| 24 // DefaultResourceType is used as the ResourceType value if Options does
n't | 24 // DefaultResourceType is used as the ResourceType value if Options does
n't |
| 25 // specify a ResourceType. | 25 // specify a ResourceType. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 c.writeError(err.Error()) | 216 c.writeError(err.Error()) |
| 217 } | 217 } |
| 218 return err | 218 return err |
| 219 } | 219 } |
| 220 | 220 |
| 221 func (c *clientImpl) writeError(f string, args ...interface{}) { | 221 func (c *clientImpl) writeError(f string, args ...interface{}) { |
| 222 if c.ErrorWriter != nil { | 222 if c.ErrorWriter != nil { |
| 223 c.ErrorWriter(fmt.Sprintf(f, args...)) | 223 c.ErrorWriter(fmt.Sprintf(f, args...)) |
| 224 } | 224 } |
| 225 } | 225 } |
| OLD | NEW |