Documentation
¶
Index ¶
- Variables
- func CaptureLogs(c chan<- Param)
- func DecodeOther(other interface{}, cc interface{}) error
- func DefaultPort(conn string, port int) string
- func DefaultScheme(uri string, scheme string) string
- func FormatValue(format string, val interface{}) string
- func Getenv(key string, def ...string) string
- func LocalIPs() (ips []net.IPNet)
- func LogLevel(defaultLevel string, areaLevels map[string]string)
- func LogLevelForArea(area string) jww.Threshold
- func LogLevelToThreshold(level string) jww.Threshold
- func Loggers(cb func(string, *Logger))
- func ReplaceFormatted(s string, kv map[string]interface{}) (string, error)
- func Truish(s string) bool
- type Cache
- type Logger
- type Param
- type Tee
- type TeeAttacher
- type Waiter
Constants ¶
This section is empty.
Variables ¶
var ( // OutThreshold is the default console log level OutThreshold = jww.LevelError // LogThreshold is the default log file level LogThreshold = jww.LevelWarn )
var LogAreaPadding = 6
LogAreaPadding of log areas
Functions ¶
func CaptureLogs ¶
func CaptureLogs(c chan<- Param)
CaptureLogs appends uiWriter to relevant log levels
func DecodeOther ¶
func DecodeOther(other interface{}, cc interface{}) error
DecodeOther uses mapstructure to decode into target structure. Unused keys cause errors.
func DefaultPort ¶
DefaultPort appends given port to connection if not specified
func DefaultScheme ¶
DefaultScheme prepends given scheme to uri if not specified
func FormatValue ¶
FormatValue will apply specific formatting in addition to standard sprintf
func LogLevelForArea ¶
LogLevelForArea gets the log level for given log area
func LogLevelToThreshold ¶
LogLevelToThreshold converts log level string to a jww Threshold
func ReplaceFormatted ¶
ReplaceFormatted replaces all occurrences of ${key} with formatted val from the kv map
Types ¶
type Cache ¶
Cache is a data store
func (*Cache) GetChecked ¶
GetChecked returns checked value from cache
type Logger ¶
Logger wraps a jww notepad to avoid leaking implementation detail
type Tee ¶
type Tee struct {
// contains filtered or unexported fields
}
Tee distributed parameters to subscribers
type TeeAttacher ¶
type TeeAttacher interface {
Attach() <-chan Param
}
TeeAttacher allows to attach a listener to a tee