Skip to content

Commit 32b0e02

Browse files
authored
Merge branch 'master' into justforfunc
2 parents 9d03e61 + 87a28d6 commit 32b0e02

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

logpipe.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
/*
2-
Copyright 2017, Google, Inc.
3-
Licensed under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License.
5-
You may obtain a copy of the License at
6-
7-
http://www.apache.org/licenses/LICENSE-2.0
8-
9-
Unless required by applicable law or agreed to in writing, software
10-
distributed under the License is distributed on an "AS IS" BASIS,
11-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
See the License for the specific language governing permissions and
13-
limitations under the License.
14-
*/
1+
// Copyright 2017, Google, Inc.
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
1513

1614
// Command logpipe is a service that will let you pipe logs directly to Stackdriver Logging.
1715
package main
@@ -55,6 +53,8 @@ func main() {
5553
if err != nil {
5654
errorf("Failed to create client: %v", err)
5755
}
56+
errc := make(chan error)
57+
client.OnError = func(err error) { errc <- err }
5858

5959
ctx, cancel := context.WithTimeout(ctx, 1*time.Second)
6060
defer cancel()
@@ -90,7 +90,7 @@ loop:
9090
}
9191
logger.Log(logging.Entry{Payload: line})
9292
case s := <-signals:
93-
fmt.Fprintf(os.Stderr, "Terminating program after received signal: %v\n", s)
93+
fmt.Fprintf(os.Stderr, "Terminating program after receiving signal: %v\n", s)
9494
break loop
9595
}
9696
}

0 commit comments

Comments
 (0)