Documentation ¶
Overview ¶
Copyright © 2020 Marvin
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Debugf(format string, args ...any)
- func Errorf(format string, args ...any)
- func Infof(format string, args ...any)
- func SetDisplayMode(m DisplayMode)
- func SetDisplayModeFromString(m string)
- func SetStderr(w io.Writer)
- func SetStdout(w io.Writer)
- func Warnf(format string, args ...any)
- type ContextKey
- type DisplayMode
- type Logger
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) GetDisplayMode() DisplayMode
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) SetDisplayMode(m DisplayMode)
- func (l *Logger) SetDisplayModeFromString(m string)
- func (l *Logger) SetStderr(w io.Writer)
- func (l *Logger) SetStdout(w io.Writer)
- func (l *Logger) Warnf(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDisplayMode ¶
func SetDisplayMode(m DisplayMode)
SetDisplayMode changes the global output format of logger
func SetDisplayModeFromString ¶
func SetDisplayModeFromString(m string)
SetDisplayModeFromString changes the global output format of logger
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey is key used to store values in context
const ContextKeyLogger ContextKey = "logger"
ContextKeyLogger is the key used for logger stored in context
type DisplayMode ¶
type DisplayMode int
DisplayMode control the output format
const ( DisplayModeDefault DisplayMode = iota // default is the interactive output DisplayModePlain // plain text DisplayModeJSON // JSON )
display modes
func GetDisplayMode ¶
func GetDisplayMode() DisplayMode
GetDisplayMode returns the current global output format
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a set of fuctions writing output to custom writters, but still using the global zap logger as our default config does not writes everything to a memory buffer. TODO: use also separate zap loggers
func (*Logger) GetDisplayMode ¶
func (l *Logger) GetDisplayMode() DisplayMode
GetDisplayMode returns the current output format
func (*Logger) SetDisplayMode ¶
func (l *Logger) SetDisplayMode(m DisplayMode)
SetDisplayMode changes the output format of logger
func (*Logger) SetDisplayModeFromString ¶
SetDisplayModeFromString changes the output format of logger