Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Improve user communication
Browse files Browse the repository at this point in the history
Fill in TODO in README to reflect GitHub address. Add consistent
product+version report to stdout on all tools. Connector gets
stdout and glog.

Change-Id: I55480b5c3e83a22835bf58ac662beec02d263089
  • Loading branch information
Jacob Marble committed Mar 4, 2015
1 parent a260795 commit 6e27205
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ https://developers.google.com/open-source/licenses/bsd
# Install
```
$ cd ~/go/src
$ go get TODO/cups-connector
$ go get github.com/google/cups-connector
$ go get github.com/golang/oauth2
$ go get github.com/golang/glog
$ cd cups-connector/connector
Expand Down
2 changes: 1 addition & 1 deletion connector-init/connector-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ func stringToBool(val string) (bool, bool) {

func main() {
flag.Parse()
fmt.Println("Google Cloud Print CUPS Connector version", lib.GetBuildDate())

var parsed bool

var retainUserOAuthToken bool
if parsed, retainUserOAuthToken = stringToBool(*retainUserOAuthTokenFlag); !parsed {
retainUserOAuthToken = scanYesOrNo(
Expand Down
2 changes: 1 addition & 1 deletion connector-monitor/connector-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var timeoutFlag = flag.Duration(

func main() {
flag.Parse()
fmt.Printf("CUPS Connector version %s\n", lib.GetBuildDate())
fmt.Println("Google Cloud Print CUPS Connector version", lib.GetBuildDate())

config, err := lib.ConfigFromFile()
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions connector-util/connector-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ var (

func main() {
flag.Parse()
fmt.Println("Google Cloud Print CUPS Connector version", lib.GetBuildDate())

if *deleteAllGCPPrintersFlag {
deleteAllGCPPrinters()
} else if *updateConfigFileFlag {
Expand Down
11 changes: 6 additions & 5 deletions connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
func main() {
flag.Parse()
defer glog.Flush()

glog.Errorf("CUPS Connector version %s", lib.GetBuildDate())
glog.Errorf("Google Cloud Print CUPS Connector version %s", lib.GetBuildDate())
fmt.Println("Google Cloud Print CUPS Connector version", lib.GetBuildDate())

config, err := lib.ConfigFromFile()
if err != nil {
Expand Down Expand Up @@ -76,7 +76,6 @@ func main() {
if err := gcp.StartXMPP(); err != nil {
glog.Fatal(err)
}
glog.Info("Started XMPP successfully")

pm, err := manager.NewPrinterManager(cups, gcp, config.CUPSPrinterPollInterval,
config.GCPMaxConcurrentDownloads, config.CUPSJobQueueSize, config.CUPSJobFullUsername,
Expand All @@ -92,12 +91,14 @@ func main() {
}
defer m.Quit()

fmt.Printf("Google Cloud Print CUPS Connector ready to rock as proxy '%s'\n", config.ProxyName)
glog.Errorf("Ready to rock as proxy '%s'\n", config.ProxyName)
fmt.Printf("Ready to rock as proxy '%s'\n", config.ProxyName)

waitIndefinitely()

glog.Error("Shutting down")
fmt.Println("")
fmt.Println("shutting down normally")
fmt.Println("Shutting down")
}

// Blocks until Ctrl-C or SIGTERM.
Expand Down

0 comments on commit 6e27205

Please sign in to comment.