forked from LaconicNetwork/kompose
Something within golang.org/x/sys messed up and it doesn't help that we
have three different projects using different versions.
This vendor update specifies a golang.org/x/sys as well as fixes the
previous compiling issues with Windows/Linux/macOS builds.
See issue:
```sh
gox -osarch="darwin/amd64 linux/amd64 linux/arm windows/amd64"
-output="bin/kompose-{{.OS}}-{{.Arch}}" -ldflags="-w -X
github.com/kubernetes/kompose/pkg/version.GITCOMMIT=42e7f0e"
Number of parallel builds: 1
--> windows/amd64: github.com/kubernetes/kompose
--> linux/amd64: github.com/kubernetes/kompose
--> darwin/amd64: github.com/kubernetes/kompose
--> linux/arm: github.com/kubernetes/kompose
1 errors occurred:
--> windows/amd64 error: exit status 2
Stderr: #
github.com/kubernetes/kompose/vendor/golang.org/x/crypto/ssh/terminal
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:42: undefined:
windows.ENABLE_ECHO_INPUT
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:42: undefined:
windows.ENABLE_PROCESSED_INPUT
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:42: undefined:
windows.ENABLE_LINE_INPUT
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:42: undefined:
windows.ENABLE_PROCESSED_OUTPUT
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:43: undefined:
windows.SetConsoleMode
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:62: undefined:
windows.SetConsoleMode
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:67: undefined:
windows.ConsoleScreenBufferInfo
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:68: undefined:
windows.GetConsoleScreenBufferInfo
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:91: undefined:
windows.ENABLE_ECHO_INPUT
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:92: undefined:
windows.ENABLE_PROCESSED_INPUT
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go:92: too many
errors
```
114 lines
2.9 KiB
Go
114 lines
2.9 KiB
Go
// Copyright © 2016 Steve Francia <spf@spf13.com>.
|
|
//
|
|
// Use of this source code is governed by an MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package jwalterweatherman
|
|
|
|
import (
|
|
"io"
|
|
"io/ioutil"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
TRACE *log.Logger
|
|
DEBUG *log.Logger
|
|
INFO *log.Logger
|
|
WARN *log.Logger
|
|
ERROR *log.Logger
|
|
CRITICAL *log.Logger
|
|
FATAL *log.Logger
|
|
|
|
LOG *log.Logger
|
|
FEEDBACK *Feedback
|
|
|
|
defaultNotepad *Notepad
|
|
)
|
|
|
|
func reloadDefaultNotepad() {
|
|
TRACE = defaultNotepad.TRACE
|
|
DEBUG = defaultNotepad.DEBUG
|
|
INFO = defaultNotepad.INFO
|
|
WARN = defaultNotepad.WARN
|
|
ERROR = defaultNotepad.ERROR
|
|
CRITICAL = defaultNotepad.CRITICAL
|
|
FATAL = defaultNotepad.FATAL
|
|
|
|
LOG = defaultNotepad.LOG
|
|
FEEDBACK = defaultNotepad.FEEDBACK
|
|
}
|
|
|
|
func init() {
|
|
defaultNotepad = NewNotepad(LevelError, LevelWarn, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime)
|
|
reloadDefaultNotepad()
|
|
}
|
|
|
|
// SetLogThreshold set the log threshold for the default notepad. Trace by default.
|
|
func SetLogThreshold(threshold Threshold) {
|
|
defaultNotepad.SetLogThreshold(threshold)
|
|
reloadDefaultNotepad()
|
|
}
|
|
|
|
// SetLogOutput set the log output for the default notepad. Discarded by default.
|
|
func SetLogOutput(handle io.Writer) {
|
|
defaultNotepad.SetLogOutput(handle)
|
|
reloadDefaultNotepad()
|
|
}
|
|
|
|
// SetStdoutThreshold set the standard output threshold for the default notepad.
|
|
// Info by default.
|
|
func SetStdoutThreshold(threshold Threshold) {
|
|
defaultNotepad.SetStdoutThreshold(threshold)
|
|
reloadDefaultNotepad()
|
|
}
|
|
|
|
// SetPrefix set the prefix for the default logger. Empty by default.
|
|
func SetPrefix(prefix string) {
|
|
defaultNotepad.SetPrefix(prefix)
|
|
reloadDefaultNotepad()
|
|
}
|
|
|
|
// SetFlags set the flags for the default logger. "log.Ldate | log.Ltime" by default.
|
|
func SetFlags(flags int) {
|
|
defaultNotepad.SetFlags(flags)
|
|
reloadDefaultNotepad()
|
|
}
|
|
|
|
// Level returns the current global log threshold.
|
|
func LogThreshold() Threshold {
|
|
return defaultNotepad.logThreshold
|
|
}
|
|
|
|
// Level returns the current global output threshold.
|
|
func StdoutThreshold() Threshold {
|
|
return defaultNotepad.stdoutThreshold
|
|
}
|
|
|
|
// GetStdoutThreshold returns the defined Treshold for the log logger.
|
|
func GetLogThreshold() Threshold {
|
|
return defaultNotepad.GetLogThreshold()
|
|
}
|
|
|
|
// GetStdoutThreshold returns the Treshold for the stdout logger.
|
|
func GetStdoutThreshold() Threshold {
|
|
return defaultNotepad.GetStdoutThreshold()
|
|
}
|
|
|
|
// LogCountForLevel returns the number of log invocations for a given threshold.
|
|
func LogCountForLevel(l Threshold) uint64 {
|
|
return defaultNotepad.LogCountForLevel(l)
|
|
}
|
|
|
|
// LogCountForLevelsGreaterThanorEqualTo returns the number of log invocations
|
|
// greater than or equal to a given threshold.
|
|
func LogCountForLevelsGreaterThanorEqualTo(threshold Threshold) uint64 {
|
|
return defaultNotepad.LogCountForLevelsGreaterThanorEqualTo(threshold)
|
|
}
|
|
|
|
// ResetLogCounters resets the invocation counters for all levels.
|
|
func ResetLogCounters() {
|
|
defaultNotepad.ResetLogCounters()
|
|
}
|