Documentation ¶
Index ¶
- Constants
- Variables
- func AddMaskedWord(word string)
- func AddToBuffer(level, format string, args ...interface{})
- func BlueBackgroundString(format string, args ...interface{}) string
- func BlueString(format string, args ...interface{}) string
- func ConfigureFileLogger(dir, version string)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func DisableMasking()
- func EnableMasking()
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func FPrintln(w io.Writer, args ...interface{})
- func FWarning(w io.Writer, format string, args ...interface{})
- func Fail(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func GetLevel() string
- func GetOutput() io.Writer
- func GetOutputBuffer() *bytes.Buffer
- func GetOutputFormat() string
- func Green(format string, args ...interface{})
- func Hint(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Information(format string, args ...interface{})
- func Init(level logrus.Level)
- func IsDebug() bool
- func IsInteractive() bool
- func Print(args ...interface{})
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func Question(format string, args ...interface{}) error
- func RedString(format string, args ...interface{}) string
- func SetLevel(level string)
- func SetOutput(output io.Writer)
- func SetOutputFormat(format string)
- func SetStage(stage string)
- func Spinner(text string)
- func StartSpinner()
- func StopSpinner()
- func Success(format string, args ...interface{})
- func Warning(format string, args ...interface{})
- func Yellow(format string, args ...interface{})
- type JSONLogFormat
- type JSONWriter
- func (w *JSONWriter) AddToBuffer(level, format string, a ...interface{})
- func (w *JSONWriter) Debug(args ...interface{})
- func (*JSONWriter) Debugf(format string, args ...interface{})
- func (*JSONWriter) Error(args ...interface{})
- func (*JSONWriter) Errorf(format string, args ...interface{})
- func (w *JSONWriter) FPrintln(writer io.Writer, args ...interface{})
- func (*JSONWriter) FWarning(writer io.Writer, format string, args ...interface{})
- func (w *JSONWriter) Fail(format string, args ...interface{})
- func (*JSONWriter) Fatalf(format string, args ...interface{})
- func (w *JSONWriter) Fprintf(writer io.Writer, format string, a ...interface{})
- func (w *JSONWriter) Green(format string, args ...interface{})
- func (w *JSONWriter) Hint(format string, args ...interface{})
- func (*JSONWriter) Info(args ...interface{})
- func (*JSONWriter) Infof(format string, args ...interface{})
- func (w *JSONWriter) Information(format string, args ...interface{})
- func (*JSONWriter) IsInteractive() bool
- func (w *JSONWriter) Print(args ...interface{})
- func (w *JSONWriter) Printf(format string, a ...interface{})
- func (w *JSONWriter) Println(args ...interface{})
- func (*JSONWriter) Question(_ string, _ ...interface{}) error
- func (w *JSONWriter) Success(format string, args ...interface{})
- func (w *JSONWriter) Warning(format string, args ...interface{})
- func (w *JSONWriter) Write(p []byte) (n int, err error)
- func (w *JSONWriter) Yellow(format string, args ...interface{})
- type OktetoWriter
- type PlainWriter
- func (*PlainWriter) AddToBuffer(level, format string, a ...interface{})
- func (w *PlainWriter) Debug(args ...interface{})
- func (*PlainWriter) Debugf(format string, args ...interface{})
- func (*PlainWriter) Error(args ...interface{})
- func (*PlainWriter) Errorf(format string, args ...interface{})
- func (w *PlainWriter) FPrintln(writer io.Writer, args ...interface{})
- func (w *PlainWriter) FWarning(writer io.Writer, format string, args ...interface{})
- func (w *PlainWriter) Fail(format string, args ...interface{})
- func (*PlainWriter) Fatalf(format string, args ...interface{})
- func (w *PlainWriter) Fprintf(writer io.Writer, format string, a ...interface{})
- func (w *PlainWriter) Green(format string, args ...interface{})
- func (w *PlainWriter) Hint(format string, args ...interface{})
- func (*PlainWriter) Info(args ...interface{})
- func (*PlainWriter) Infof(format string, args ...interface{})
- func (w *PlainWriter) Information(format string, args ...interface{})
- func (*PlainWriter) IsInteractive() bool
- func (w *PlainWriter) Print(args ...interface{})
- func (w *PlainWriter) Printf(format string, a ...interface{})
- func (w *PlainWriter) Println(args ...interface{})
- func (w *PlainWriter) Question(format string, args ...interface{}) error
- func (w *PlainWriter) Success(format string, args ...interface{})
- func (w *PlainWriter) Warning(format string, args ...interface{})
- func (w *PlainWriter) Write(p []byte) (n int, err error)
- func (w *PlainWriter) Yellow(format string, args ...interface{})
- type SilentWriter
- func (*SilentWriter) AddToBuffer(level, format string, a ...interface{})
- func (w *SilentWriter) Debug(args ...interface{})
- func (w *SilentWriter) Debugf(format string, args ...interface{})
- func (w *SilentWriter) Error(args ...interface{})
- func (w *SilentWriter) Errorf(format string, args ...interface{})
- func (w *SilentWriter) FPrintln(writer io.Writer, args ...interface{})
- func (w *SilentWriter) FWarning(writer io.Writer, format string, args ...interface{})
- func (w *SilentWriter) Fail(format string, args ...interface{})
- func (w *SilentWriter) Fatalf(format string, args ...interface{})
- func (w *SilentWriter) Fprintf(writer io.Writer, format string, a ...interface{})
- func (w *SilentWriter) Green(format string, args ...interface{})
- func (w *SilentWriter) Hint(format string, args ...interface{})
- func (w *SilentWriter) Info(args ...interface{})
- func (*SilentWriter) Infof(format string, args ...interface{})
- func (w *SilentWriter) Information(format string, args ...interface{})
- func (*SilentWriter) IsInteractive() bool
- func (w *SilentWriter) Print(args ...interface{})
- func (w *SilentWriter) Printf(format string, a ...interface{})
- func (w *SilentWriter) Println(args ...interface{})
- func (w *SilentWriter) Question(format string, args ...interface{}) error
- func (w *SilentWriter) Success(format string, args ...interface{})
- func (w *SilentWriter) Warning(format string, args ...interface{})
- func (w *SilentWriter) Write(p []byte) (n int, err error)
- func (w *SilentWriter) Yellow(format string, args ...interface{})
- type TTYWriter
- func (*TTYWriter) AddToBuffer(level, format string, a ...interface{})
- func (w *TTYWriter) Debug(args ...interface{})
- func (*TTYWriter) Debugf(format string, args ...interface{})
- func (*TTYWriter) Error(args ...interface{})
- func (*TTYWriter) Errorf(format string, args ...interface{})
- func (w *TTYWriter) FPrintln(writer io.Writer, args ...interface{})
- func (w *TTYWriter) FWarning(writer io.Writer, format string, args ...interface{})
- func (w *TTYWriter) Fail(format string, args ...interface{})
- func (*TTYWriter) Fatalf(format string, args ...interface{})
- func (w *TTYWriter) Fprintf(writer io.Writer, format string, a ...interface{})
- func (w *TTYWriter) Green(format string, args ...interface{})
- func (w *TTYWriter) Hint(format string, args ...interface{})
- func (*TTYWriter) Info(args ...interface{})
- func (*TTYWriter) Infof(format string, args ...interface{})
- func (w *TTYWriter) Information(format string, args ...interface{})
- func (*TTYWriter) IsInteractive() bool
- func (w *TTYWriter) Print(args ...interface{})
- func (w *TTYWriter) Printf(format string, a ...interface{})
- func (w *TTYWriter) Println(args ...interface{})
- func (w *TTYWriter) Question(format string, args ...interface{}) error
- func (w *TTYWriter) Success(format string, args ...interface{})
- func (w *TTYWriter) Warning(format string, args ...interface{})
- func (w *TTYWriter) Write(p []byte) (n int, err error)
- func (w *TTYWriter) Yellow(format string, args ...interface{})
Constants ¶
const ( // TTYFormat represents a tty logger TTYFormat string = "tty" // PlainFormat represents a plain logger PlainFormat string = "plain" // JSONFormat represents a json logger JSONFormat string = "json" // SilentFormat represents a silent logger SilentFormat string = "silent" )
const (
// OktetoDisableSpinnerEnvVar if true spinner is disabled
OktetoDisableSpinnerEnvVar = "OKTETO_DISABLE_SPINNER"
)
Variables ¶
var ( // InfoLevel is the json level for information InfoLevel = "info" // WarningLevel is the json level for warning WarningLevel = "warn" // ErrorLevel is the json level for error ErrorLevel = "error" // DebugLevel is the json level for debug DebugLevel = "debug" )
Functions ¶
func AddMaskedWord ¶
func AddMaskedWord(word string)
AddMaskedWord adds a new word to be redacted, only if longer than 5 chars
func AddToBuffer ¶
func AddToBuffer(level, format string, args ...interface{})
AddToBuffer logs into the buffer but does not print anything
func BlueBackgroundString ¶
BlueBackgroundString returns a string in a blue background
func BlueString ¶
BlueString returns a string in blue
func ConfigureFileLogger ¶
func ConfigureFileLogger(dir, version string)
ConfigureFileLogger configures the file to write
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf writes a debug-level log with a format
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf writes a error-level log with a format
func FWarning ¶
FWarning prints a message with the warning symbol first, and the text in yellow to a specific writer
func Fail ¶
func Fail(format string, args ...interface{})
Fail prints a message with the error symbol first, and the text in red
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf writes a error-level log with a format
func GetOutputBuffer ¶
GetOutputBuffer returns the buffer of the running command
func GetOutputFormat ¶
func GetOutputFormat() string
GetOutputFormat returns the output format of the command
func Hint ¶
func Hint(format string, args ...interface{})
Hint prints a message with the text in blue
func Infof ¶
func Infof(format string, args ...interface{})
Infof writes a info-level log with a format
func Information ¶
func Information(format string, args ...interface{})
Information prints a message with the information symbol first, and the text in blue
func Spinner ¶
func Spinner(text string)
Spinner sets the text provided as Suffix and FinalMSG of the spinner instance
func StartSpinner ¶
func StartSpinner()
StartSpinner starts to run the spinner if enabled or Println if not
func StopSpinner ¶
func StopSpinner()
StopSpinner deletes FinalMSG and stops the running of the spinner
func Success ¶
func Success(format string, args ...interface{})
Success prints a message with the success symbol first, and the text in green
Types ¶
type JSONLogFormat ¶
type JSONLogFormat struct { Level string `json:"level"` Stage string `json:"stage"` Message string `json:"message"` Timestamp int64 `json:"timestamp"` }
JSONLogFormat formats the messages into json struct
type JSONWriter ¶
type JSONWriter struct {
// contains filtered or unexported fields
}
JSONWriter writes into a JSON terminal
func (*JSONWriter) AddToBuffer ¶
func (w *JSONWriter) AddToBuffer(level, format string, a ...interface{})
AddToBuffer logs into the buffer and writes to stdout if its a json writer
func (*JSONWriter) Debug ¶
func (w *JSONWriter) Debug(args ...interface{})
Debug writes a debug-level log
func (*JSONWriter) Debugf ¶
func (*JSONWriter) Debugf(format string, args ...interface{})
Debugf writes a debug-level log with a format
func (*JSONWriter) Error ¶
func (*JSONWriter) Error(args ...interface{})
Error writes a error-level log
func (*JSONWriter) Errorf ¶
func (*JSONWriter) Errorf(format string, args ...interface{})
Errorf writes a error-level log with a format
func (*JSONWriter) FPrintln ¶
func (w *JSONWriter) FPrintln(writer io.Writer, args ...interface{})
FPrintln prints a line with format
func (*JSONWriter) FWarning ¶
func (*JSONWriter) FWarning(writer io.Writer, format string, args ...interface{})
FWarning prints a message with the warning symbol first, and the text in yellow
func (*JSONWriter) Fail ¶
func (w *JSONWriter) Fail(format string, args ...interface{})
Fail prints a message with the error symbol first, and the text in red
func (*JSONWriter) Fatalf ¶
func (*JSONWriter) Fatalf(format string, args ...interface{})
Fatalf writes a error-level log with a format
func (*JSONWriter) Fprintf ¶
func (w *JSONWriter) Fprintf(writer io.Writer, format string, a ...interface{})
Fprintf prints a line with format
func (*JSONWriter) Green ¶
func (w *JSONWriter) Green(format string, args ...interface{})
Green writes a line in green
func (*JSONWriter) Hint ¶
func (w *JSONWriter) Hint(format string, args ...interface{})
Hint prints a message with the text in blue
func (*JSONWriter) Infof ¶
func (*JSONWriter) Infof(format string, args ...interface{})
Infof writes a info-level log with a format
func (*JSONWriter) Information ¶
func (w *JSONWriter) Information(format string, args ...interface{})
Information prints a message with the information symbol first, and the text in blue
func (*JSONWriter) IsInteractive ¶
func (*JSONWriter) IsInteractive() bool
IsInteractive checks if the writer is interactive
func (*JSONWriter) Print ¶
func (w *JSONWriter) Print(args ...interface{})
Print writes a line with colors
func (*JSONWriter) Printf ¶
func (w *JSONWriter) Printf(format string, a ...interface{})
Printf writes a line with format
func (*JSONWriter) Println ¶
func (w *JSONWriter) Println(args ...interface{})
Println writes a line with colors
func (*JSONWriter) Question ¶
func (*JSONWriter) Question(_ string, _ ...interface{}) error
Question prints a message with the question symbol first, and the text in magenta
func (*JSONWriter) Success ¶
func (w *JSONWriter) Success(format string, args ...interface{})
Success prints a message with the success symbol first, and the text in green
func (*JSONWriter) Warning ¶
func (w *JSONWriter) Warning(format string, args ...interface{})
Warning prints a message with the warning symbol first, and the text in yellow
func (*JSONWriter) Write ¶
func (w *JSONWriter) Write(p []byte) (n int, err error)
Write logs into the buffer but does not print anything
func (*JSONWriter) Yellow ¶
func (w *JSONWriter) Yellow(format string, args ...interface{})
Yellow writes a line in yellow
type OktetoWriter ¶
type OktetoWriter interface { Debug(args ...interface{}) Debugf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fail(format string, args ...interface{}) Fatalf(format string, args ...interface{}) Yellow(format string, args ...interface{}) Green(format string, args ...interface{}) Success(format string, args ...interface{}) Information(format string, args ...interface{}) Question(format string, args ...interface{}) error Warning(format string, args ...interface{}) FWarning(w io.Writer, format string, args ...interface{}) Hint(format string, args ...interface{}) Println(args ...interface{}) FPrintln(w io.Writer, args ...interface{}) Print(args ...interface{}) Fprintf(w io.Writer, format string, a ...interface{}) Printf(format string, a ...interface{}) IsInteractive() bool AddToBuffer(level, format string, a ...interface{}) Write(p []byte) (n int, err error) }
OktetoWriter implements the interface of the writers
type PlainWriter ¶
type PlainWriter struct {
// contains filtered or unexported fields
}
PlainWriter writes into a plain terminal
func (*PlainWriter) AddToBuffer ¶
func (*PlainWriter) AddToBuffer(level, format string, a ...interface{})
AddToBuffer logs into the buffer but does not print anything
func (*PlainWriter) Debug ¶
func (w *PlainWriter) Debug(args ...interface{})
Debug writes a debug-level log
func (*PlainWriter) Debugf ¶
func (*PlainWriter) Debugf(format string, args ...interface{})
Debugf writes a debug-level log with a format
func (*PlainWriter) Error ¶
func (*PlainWriter) Error(args ...interface{})
Error writes a error-level log
func (*PlainWriter) Errorf ¶
func (*PlainWriter) Errorf(format string, args ...interface{})
Errorf writes a error-level log with a format
func (*PlainWriter) FPrintln ¶
func (w *PlainWriter) FPrintln(writer io.Writer, args ...interface{})
FPrintln prints a line with format
func (*PlainWriter) FWarning ¶
func (w *PlainWriter) FWarning(writer io.Writer, format string, args ...interface{})
FWarning prints a message with the warning symbol first, and the text in yellow into an specific writer
func (*PlainWriter) Fail ¶
func (w *PlainWriter) Fail(format string, args ...interface{})
Fail prints a message with the error symbol first, and the text in red
func (*PlainWriter) Fatalf ¶
func (*PlainWriter) Fatalf(format string, args ...interface{})
Fatalf writes a error-level log with a format
func (*PlainWriter) Fprintf ¶
func (w *PlainWriter) Fprintf(writer io.Writer, format string, a ...interface{})
Fprintf prints a line with format
func (*PlainWriter) Green ¶
func (w *PlainWriter) Green(format string, args ...interface{})
Green writes a line in green
func (*PlainWriter) Hint ¶
func (w *PlainWriter) Hint(format string, args ...interface{})
Hint prints a message with the text in blue
func (*PlainWriter) Info ¶
func (*PlainWriter) Info(args ...interface{})
Info writes a info-level log
func (*PlainWriter) Infof ¶
func (*PlainWriter) Infof(format string, args ...interface{})
Infof writes a info-level log with a format
func (*PlainWriter) Information ¶
func (w *PlainWriter) Information(format string, args ...interface{})
Information prints a message with the information symbol first, and the text in blue
func (*PlainWriter) IsInteractive ¶
func (*PlainWriter) IsInteractive() bool
IsInteractive checks if the writer is interactive
func (*PlainWriter) Print ¶
func (w *PlainWriter) Print(args ...interface{})
Print writes a line with colors
func (*PlainWriter) Printf ¶
func (w *PlainWriter) Printf(format string, a ...interface{})
Printf writes a line with format
func (*PlainWriter) Println ¶
func (w *PlainWriter) Println(args ...interface{})
Println writes a line with colors
func (*PlainWriter) Question ¶
func (w *PlainWriter) Question(format string, args ...interface{}) error
Question prints a message with the question symbol first, and the text in magenta
func (*PlainWriter) Success ¶
func (w *PlainWriter) Success(format string, args ...interface{})
Success prints a message with the success symbol first, and the text in green
func (*PlainWriter) Warning ¶
func (w *PlainWriter) Warning(format string, args ...interface{})
Warning prints a message with the warning symbol first, and the text in yellow
func (*PlainWriter) Write ¶
func (w *PlainWriter) Write(p []byte) (n int, err error)
Write logs into the buffer but does not print anything
func (*PlainWriter) Yellow ¶
func (w *PlainWriter) Yellow(format string, args ...interface{})
Yellow writes a line in yellow
type SilentWriter ¶
type SilentWriter struct {
// contains filtered or unexported fields
}
SilentWriter writes into a plain terminal
func (*SilentWriter) AddToBuffer ¶
func (*SilentWriter) AddToBuffer(level, format string, a ...interface{})
AddToBuffer logs into the buffer but does not print anything
func (*SilentWriter) Debug ¶
func (w *SilentWriter) Debug(args ...interface{})
Debug writes a debug-level log
func (*SilentWriter) Debugf ¶
func (w *SilentWriter) Debugf(format string, args ...interface{})
Debugf writes a debug-level log with a format
func (*SilentWriter) Error ¶
func (w *SilentWriter) Error(args ...interface{})
Error writes a error-level log
func (*SilentWriter) Errorf ¶
func (w *SilentWriter) Errorf(format string, args ...interface{})
Errorf writes a error-level log with a format
func (*SilentWriter) FPrintln ¶
func (w *SilentWriter) FPrintln(writer io.Writer, args ...interface{})
FPrintln prints a line with format
func (*SilentWriter) FWarning ¶
func (w *SilentWriter) FWarning(writer io.Writer, format string, args ...interface{})
FWarning prints a message with the warning symbol first, and the text in yellow into an specific writer
func (*SilentWriter) Fail ¶
func (w *SilentWriter) Fail(format string, args ...interface{})
Fail prints a message with the error symbol first, and the text in red
func (*SilentWriter) Fatalf ¶
func (w *SilentWriter) Fatalf(format string, args ...interface{})
Fatalf writes a error-level log with a format
func (*SilentWriter) Fprintf ¶
func (w *SilentWriter) Fprintf(writer io.Writer, format string, a ...interface{})
Fprintf prints a line with format
func (*SilentWriter) Green ¶
func (w *SilentWriter) Green(format string, args ...interface{})
Green writes a line in green
func (*SilentWriter) Hint ¶
func (w *SilentWriter) Hint(format string, args ...interface{})
Hint prints a message with the text in blue
func (*SilentWriter) Info ¶
func (w *SilentWriter) Info(args ...interface{})
Info writes a info-level log
func (*SilentWriter) Infof ¶
func (*SilentWriter) Infof(format string, args ...interface{})
Infof writes a info-level log with a format
func (*SilentWriter) Information ¶
func (w *SilentWriter) Information(format string, args ...interface{})
Information prints a message with the information symbol first, and the text in blue
func (*SilentWriter) IsInteractive ¶
func (*SilentWriter) IsInteractive() bool
IsInteractive checks if the writer is interactive
func (*SilentWriter) Print ¶
func (w *SilentWriter) Print(args ...interface{})
Print writes a line with colors
func (*SilentWriter) Printf ¶
func (w *SilentWriter) Printf(format string, a ...interface{})
Printf writes a line with format
func (*SilentWriter) Println ¶
func (w *SilentWriter) Println(args ...interface{})
Println writes a line with colors
func (*SilentWriter) Question ¶
func (w *SilentWriter) Question(format string, args ...interface{}) error
Question prints a message with the question symbol first, and the text in magenta
func (*SilentWriter) Success ¶
func (w *SilentWriter) Success(format string, args ...interface{})
Success prints a message with the success symbol first, and the text in green
func (*SilentWriter) Warning ¶
func (w *SilentWriter) Warning(format string, args ...interface{})
Warning prints a message with the warning symbol first, and the text in yellow
func (*SilentWriter) Write ¶
func (w *SilentWriter) Write(p []byte) (n int, err error)
Write logs into the buffer but does not print anything
func (*SilentWriter) Yellow ¶
func (w *SilentWriter) Yellow(format string, args ...interface{})
Yellow writes a line in yellow
type TTYWriter ¶
type TTYWriter struct {
// contains filtered or unexported fields
}
TTYWriter writes into a tty terminal
func (*TTYWriter) AddToBuffer ¶
AddToBuffer logs into the buffer but does not print anything
func (*TTYWriter) Debug ¶
func (w *TTYWriter) Debug(args ...interface{})
Debug writes a debug-level log
func (*TTYWriter) Error ¶
func (*TTYWriter) Error(args ...interface{})
Error writes a error-level log
func (*TTYWriter) FWarning ¶
FWarning prints a message with the warning symbol first, and the text in yellow into an specific writer
func (*TTYWriter) Information ¶
Information prints a message with the information symbol first, and the text in blue
func (*TTYWriter) IsInteractive ¶
IsInteractive checks if the writer is interactive
func (*TTYWriter) Print ¶
func (w *TTYWriter) Print(args ...interface{})
Print writes a line with colors
func (*TTYWriter) Println ¶
func (w *TTYWriter) Println(args ...interface{})
Println writes a line with colors
func (*TTYWriter) Question ¶
Question prints a message with the question symbol first, and the text in magenta
func (*TTYWriter) Success ¶
Success prints a message with the success symbol first, and the text in green
func (*TTYWriter) Warning ¶
Warning prints a message with the warning symbol first, and the text in yellow