-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add leveled logging I reused the `—v` flag for glog to set the desiered log level. By default we only log messages with no level or level 0. For the flag processing to work I had to move the logger creation into the cobra commands `Run` functions because otherwise I can’t access the flag without hussle. I moved the logging setup to logutil.NewLogger() to that we can reuse that function in all binaries. * Remove unused functions * Refactor wormhole server use one flat Options struct for both the controller and the tunnel. They are not meant to be run independently and share some things (e.g. logger) Also consolidated the server in a single package because
- Loading branch information
Showing
20 changed files
with
188 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
goflag "flag" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/golang/glog" | ||
|
||
"github.com/sapcc/kubernikus/pkg/cmd" | ||
"github.com/sapcc/kubernikus/pkg/cmd/kubernikusctl" | ||
) | ||
|
||
func main() { | ||
defer glog.Flush() | ||
|
||
baseName := filepath.Base(os.Args[0]) | ||
if f := flag.Lookup("logtostderr"); f != nil { | ||
if f := goflag.Lookup("logtostderr"); f != nil { | ||
f.Value.Set("true") | ||
} | ||
|
||
baseName := filepath.Base(os.Args[0]) | ||
|
||
err := kubernikusctl.NewCommand(baseName).Execute() | ||
cmd.CheckError(err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.