Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/op/go-logging
/ functions
Functions
136 in github.com/op/go-logging
⨍
Functions
136
◇
Types & classes
28
↓ 44 callers
Method
Errorf
Errorf logs a message using ERROR as log level.
logger.go:213
↓ 31 callers
Method
Formatted
Formatted returns the formatted log record string.
logger.go:59
↓ 25 callers
Function
MemoryRecordN
TODO share more code between these tests
memory_test.go:13
↓ 23 callers
Method
SetLevel
(Level, string)
level.go:57
↓ 20 callers
Function
SetBackend
SetBackend replaces the backend currently set with the given new logging backend.
backend.go:18
↓ 17 callers
Function
MustGetLogger
MustGetLogger is like GetLogger but panics if the logger can't be created. It simplifies safe initialization of a global logger for eg. a package.
logger.go:118
↓ 16 callers
Method
log
(lvl Level, format *string, args ...interface{})
logger.go:143
↓ 12 callers
Function
NewLogBackend
NewLogBackend creates a new LogBackend.
log_nix.go:54
↓ 12 callers
Function
NewMemoryBackend
NewMemoryBackend creates a simple in-memory logging backend.
memory.go:56
↓ 11 callers
Function
InitForTesting
TODO pick one of the memory backends and stick with it or share interface. InitForTesting is a convenient method when using logging in a test. Once ca
memory.go:20
↓ 10 callers
Method
Debug
Debug logs a message using DEBUG as log level.
logger.go:248
↓ 10 callers
Function
MustStringFormatter
MustStringFormatter is equivalent to NewStringFormatter with a call to panic on error.
format.go:262
↓ 8 callers
Function
AddModuleLevel
AddModuleLevel wraps a log backend with knobs to have different log levels for different modules.
level.go:77
↓ 8 callers
Function
RunLogBenchmark
(b *testing.B)
log_test.go:133
↓ 7 callers
Function
SetFormatter
SetFormatter sets the default formatter for all new backends. A backend will fetch this value once it is needed to format a record. Note that backends
format.go:132
↓ 7 callers
Method
String
String returns the string representation of a logging level.
level.go:39
↓ 6 callers
Function
ColorSeq
(color color)
log_nix.go:93
↓ 6 callers
Function
ColorSeqBold
(color color)
log_nix.go:97
↓ 6 callers
Function
formatFuncName
formatFuncName tries to extract certain part of the runtime formatted function name to some pre-defined variation. This function is known to not work
format.go:341
↓ 6 callers
Function
testCallpath
(t *testing.T, format string, expect string)
log_test.go:47
↓ 5 callers
Function
ChannelMemoryRecordN
(b *ChannelMemoryBackend, n int)
memory_test.go:27
↓ 5 callers
Method
Error
Error logs a message using ERROR as log level.
logger.go:208
↓ 5 callers
Method
Info
Info logs a message using INFO as log level.
logger.go:238
↓ 5 callers
Method
Log
(Level, int, *Record)
backend.go:13
↓ 4 callers
Method
Format
(calldepth int, r *Record, w io.Writer)
format.go:105
↓ 4 callers
Method
Notice
Notice logs a message using NOTICE as log level.
logger.go:228
↓ 4 callers
Function
getLastLine
(backend *MemoryBackend)
format_test.go:35
↓ 3 callers
Method
Debugf
Debugf logs a message using DEBUG as log level.
logger.go:253
↓ 3 callers
Method
Flush
Flush waits until all records in the buffered channel have been processed.
memory.go:207
↓ 3 callers
Method
GetLevel
(string)
level.go:56
↓ 3 callers
Method
IsEnabledFor
(Level, string)
level.go:58
↓ 3 callers
Function
MultiLogger
MultiLogger creates a logger which contain multiple loggers.
multi.go:16
↓ 3 callers
Method
add
(verb fmtVerb, layout string)
format.go:270
↓ 3 callers
Function
logAndGetLine
(backend *MemoryBackend)
format_test.go:30
↓ 2 callers
Method
Head
Head returns the oldest record node kept in memory. It can be used to iterate over records, one by one, up to the last record. Note: new records can
memory.go:117
↓ 2 callers
Method
Infof
Infof logs a message using INFO as log level.
logger.go:243
↓ 2 callers
Function
LogLevel
LogLevel returns the log level from a string representation.
level.go:44
↓ 2 callers
Function
NewBackendFormatter
NewBackendFormatter creates a new backend which makes all records that passes through it beeing formatted by the specific formatter.
format.go:404
↓ 2 callers
Function
NewChannelMemoryBackend
NewChannelMemoryBackend creates a simple in-memory logging backend which utilizes a go channel for communication. Start will automatically be called
memory.go:146
↓ 2 callers
Function
NewStringFormatter
NewStringFormatter returns a new Formatter which outputs the log record as a string based on the 'verbs' specified in the format string. The verbs:
format.go:199
↓ 2 callers
Method
Next
Next returns the next record node. If there's no node available, it will return nil.
memory.go:43
↓ 2 callers
Function
Reset
Reset restores the internal state of the logging library.
logger.go:127
↓ 2 callers
Function
RunLogBenchmarkFixedString
(b *testing.B)
log_test.go:156
↓ 2 callers
Method
SetBackend
SetBackend overrides any previously defined backend for this logger.
logger.go:104
↓ 2 callers
Method
Warning
Warning logs a message using WARNING as log level.
logger.go:218
↓ 2 callers
Method
insertRecord
(rec *Record)
memory.go:190
↓ 2 callers
Function
setConsoleTextAttribute
setConsoleTextAttribute sets the attributes of characters written to the console screen buffer by the WriteFile or WriteConsole function. See http://m
log_windows.go:99
↓ 1 callers
Method
Critical
Critical logs a message using CRITICAL as log level.
logger.go:198
↓ 1 callers
Method
Fatal
Fatal is equivalent to l.Critical(fmt.Sprint()) followed by a call to os.Exit(1).
logger.go:174
↓ 1 callers
Method
Fatalf
Fatalf is equivalent to l.Critical followed by a call to os.Exit(1).
logger.go:180
↓ 1 callers
Method
Fd
()
log_windows.go:58
↓ 1 callers
Method
GetLevel
GetLevel returns the log level for the given module.
level.go:90
↓ 1 callers
Function
GetLogger
TODO call NewLogger and remove MustGetLogger? GetLogger creates and returns a Logger object based on the module name.
logger.go:112
↓ 1 callers
Method
IsEnabledFor
IsEnabledFor returns true if the logger is enabled for the given level.
logger.go:139
↓ 1 callers
Method
IsEnabledFor
IsEnabledFor will return true if logging is enabled for the given module.
level.go:108
↓ 1 callers
Method
Log
(backend *MemoryBackend)
format_test.go:45
↓ 1 callers
Method
Message
Message returns the log record message.
logger.go:69
↓ 1 callers
Function
Redact
Redact returns a string of * having the same length as s.
logger.go:28
↓ 1 callers
Method
Redacted
()
logger.go:24
↓ 1 callers
Method
Start
Start launches the internal goroutine which starts processing data from the input channel.
memory.go:158
↓ 1 callers
Function
a
(log *Logger)
log_test.go:37
↓ 1 callers
Function
b
(log *Logger)
log_test.go:36
↓ 1 callers
Function
c
(log *Logger)
log_test.go:35
↓ 1 callers
Function
doFmtVerbLevelColor
(layout string, level Level, output io.Writer)
log_nix.go:101
↓ 1 callers
Function
formatCallpath
(calldepth int, depth int)
format.go:362
↓ 1 callers
Function
getFmtVerbByName
(name string)
format.go:94
↓ 1 callers
Function
getFormatter
()
format.go:114
↓ 1 callers
Method
getFormatterAndCacheCurrent
()
level.go:121
↓ 1 callers
Method
process
()
memory.go:170
↓ 1 callers
Function
realFunc
(backend *MemoryBackend)
format_test.go:39
↓ 1 callers
Function
rec
(log *Logger, r int)
log_test.go:39
Function
BenchmarkLogChannelMemoryBackend
(b *testing.B)
log_test.go:92
Function
BenchmarkLogFixed
(b *testing.B)
log_test.go:143
Function
BenchmarkLogFixedIgnored
(b *testing.B)
log_test.go:150
Function
BenchmarkLogLeveled
(b *testing.B)
log_test.go:100
Function
BenchmarkLogLogBackend
(b *testing.B)
log_test.go:107
Function
BenchmarkLogLogBackendColor
(b *testing.B)
log_test.go:113
Function
BenchmarkLogLogBackendLongFileFlag
(b *testing.B)
log_test.go:127
Function
BenchmarkLogLogBackendStdFlags
(b *testing.B)
log_test.go:121
Function
BenchmarkLogMemoryBackend
(b *testing.B)
log_test.go:86
Function
BenchmarkLogMemoryBackendIgnored
(b *testing.B)
log_test.go:80
Function
BenchmarkStringFormatter
(b *testing.B)
format_test.go:167
Function
ConvertColors
ConvertColors takes a list of ints representing colors for log levels and converts them into strings for ANSI color formatting
log_nix.go:80
Method
Criticalf
Criticalf logs a message using CRITICAL as log level.
logger.go:203
Function
Example
()
example_test.go:5
Method
Format
(calldepth int, r *Record, output io.Writer)
format.go:274
Function
GetLevel
GetLevel returns the logging level for the specified module.
backend.go:37
Method
GetLevel
GetLevel returns the highest level enabled by all backends.
multi.go:40
Method
Head
Head returns the oldest record node kept in memory. It can be used to iterate over records, one by one, up to the last record. Note: new records can
memory.go:235
Method
IsEnabledFor
IsEnabledFor returns true if any of the backends are enabled for it.
multi.go:58
Method
Log
(level Level, calldepth int, rec *Record)
log_windows.go:84
Method
Log
Log implements the Backend interface.
log_nix.go:59
Method
Log
Log implements the Log function required by the Backend interface.
format.go:409
Method
Log
(level Level, calldepth int, rec *Record)
level.go:112
Method
Log
Log implements the Log method required by Backend.
memory.go:61
Method
Log
Log implements the Log method required by Backend.
memory.go:225
Method
Log
Log passes the log record to all backends.
multi.go:25
Method
Log
Log implements the Backend interface.
syslog.go:35
Method
Log
(level Level, calldepth int, rec *Record)
syslog_fallback.go:26
Function
NewLogBackend
NewLogBackend creates a new LogBackend.
log_windows.go:72
next →
1–100 of 136, ranked by callers