Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/sirupsen/logrus
/ functions
Functions
506 in github.com/sirupsen/logrus
⨍
Functions
506
◇
Types & classes
58
↓ 2 callers
Method
clone
clone returns a shallow copy of h. Callers must clone fields or groups before modifying them.
hooks/slog/handler.go:162
↓ 2 callers
Function
colorize
(level Level, s string)
level.go:23
↓ 2 callers
Function
doLoggerBenchmarkWithFormatter
(b *testing.B, f logrus.Formatter)
logger_bench_test.go:105
↓ 2 callers
Method
isColored
(isTerminal bool)
text_formatter.go:127
↓ 2 callers
Function
isInvalidField
(v any)
entry.go:220
↓ 2 callers
Function
isSafeByte
isSafeByte returns true if the byte is allowed unquoted (ASCII and in the allowlist). It purposely uses byte arithmetic (no runes) for performance.
text_formatter.go:448
↓ 2 callers
Method
level
()
logger.go:399
↓ 2 callers
Method
logArgs
(level Level, panicAfter bool, args ...any)
entry.go:301
↓ 2 callers
Method
logf
(level Level, panicAfter bool, format string, args ...any)
entry.go:305
↓ 2 callers
Method
logln
logln uses Sprintln for multiple arguments to preserve Println-style spacing between args, then trims the trailing newline.
entry.go:311
↓ 2 callers
Function
parseLevel
(b []byte)
logrus.go:44
↓ 2 callers
Function
prefixFieldClashes
This is to not silently overwrite `time`, `msg`, `func` and `level` fields when dumping it. If this code wasn't there doing: logrus.WithField("level
formatter.go:55
↓ 2 callers
Function
runHandlers
()
alt_exit.go:42
↓ 2 callers
Function
sprint
sprint is fmt.Sprint with fast paths for zero or one string argument.
entry.go:573
↓ 2 callers
Method
toLogrusLevel
toLogrusLevel maps a slog level using LevelMapper or the default mapping.
hooks/slog/handler.go:70
↓ 1 callers
Function
AddHook
AddHook adds a hook to the standard logger hooks.
exported.go:51
↓ 1 callers
Method
DebugFn
(fn LogFunction)
logger.go:289
↓ 1 callers
Method
Debugf
(format string, args ...any)
logrus.go:188
↓ 1 callers
Method
Debugln
(args ...any)
logrus.go:189
↓ 1 callers
Function
DeferExitHandler
DeferExitHandler prepends a Logrus Exit handler to the list of handlers, call logrus.Exit to invoke all handlers. The handlers will also be invoked wh
alt_exit.go:74
↓ 1 callers
Method
Disable
()
logger.go:80
↓ 1 callers
Method
Dup
Dup creates a copy of the entry for further modification. Data is cloned to avoid mutating the original entry. Other fields (Logger, Time, Context, e
entry.go:112
↓ 1 callers
Method
Enabled
Enabled reports whether the handler handles records at the given level. It maps the slog level to a logrus level and consults the underlying logger.
hooks/slog/handler.go:79
↓ 1 callers
Function
Error
Error logs a message at level [ErrorLevel] on the standard logger.
exported.go:114
↓ 1 callers
Method
Errorf
(format string, args ...any)
entry.go:502
↓ 1 callers
Method
Errorln
(args ...any)
logrus.go:210
↓ 1 callers
Method
FatalFn
(fn LogFunction)
logger.go:315
↓ 1 callers
Method
Fatalln
(args ...any)
logrus.go:157
↓ 1 callers
Method
Fire
Fire all the hooks for the passed level. Used by `entry.log` to fire appropriate hooks for a log entry.
hooks.go:26
↓ 1 callers
Method
Fire
Fire forwards the provided logrus Entry to the underlying slog.Logger's Handler, mapping it to a slog.Record. Time and caller information are preserve
hooks/slog/slog.go:102
↓ 1 callers
Function
GetLevel
GetLevel returns the standard logger level.
exported.go:41
↓ 1 callers
Function
Info
Info logs a message at level [InfoLevel] on the standard logger.
exported.go:99
↓ 1 callers
Method
Infof
(format string, args ...any)
entry.go:486
↓ 1 callers
Method
Infoln
(args ...any)
entry.go:540
↓ 1 callers
Method
Levels
()
hooks.go:9
↓ 1 callers
Method
Levels
()
hooks/syslog/syslog.go:60
↓ 1 callers
Method
MarshalText
()
logrus.go:78
↓ 1 callers
Method
PanicFn
(fn LogFunction)
logger.go:320
↓ 1 callers
Function
ParseLevel
ParseLevel takes a string level and returns the Logrus log level constant.
logrus.go:40
↓ 1 callers
Method
PrintFn
(fn LogFunction)
logger.go:297
↓ 1 callers
Function
SetLevel
SetLevel sets the standard logger level.
exported.go:36
↓ 1 callers
Method
SetNoLock
SetNoLock disables the lock for situations where a file is opened with appending mode, and safe for concurrent writes to the file (within 4k message o
logger.go:395
↓ 1 callers
Function
SetOutput
SetOutput sets the standard logger output.
exported.go:20
↓ 1 callers
Method
TraceFn
(fn LogFunction)
logger.go:285
↓ 1 callers
Method
Tracef
(format string, args ...any)
logrus.go:216
↓ 1 callers
Method
Traceln
(args ...any)
logrus.go:217
↓ 1 callers
Method
Warn
(args ...any)
logger.go:260
↓ 1 callers
Method
Warn
(args ...any)
entry.go:440
↓ 1 callers
Method
Warnf
(format string, args ...any)
logrus.go:202
↓ 1 callers
Method
Warnf
(format string, args ...any)
logger.go:191
↓ 1 callers
Method
Warnf
(format string, args ...any)
entry.go:494
↓ 1 callers
Method
Warning
(args ...any)
logger.go:264
↓ 1 callers
Method
WarningFn
(fn LogFunction)
logger.go:307
↓ 1 callers
Method
Warningf
(format string, args ...any)
logrus.go:181
↓ 1 callers
Method
Warningln
(args ...any)
logrus.go:182
↓ 1 callers
Method
Warningln
(args ...any)
logger.go:363
↓ 1 callers
Method
Warnln
(args ...any)
logrus.go:203
↓ 1 callers
Method
Warnln
(args ...any)
logger.go:359
↓ 1 callers
Method
Warnln
(args ...any)
entry.go:548
↓ 1 callers
Method
WithAttrs
WithAttrs returns a new Handler whose attributes consist of h's attributes followed by attrs.
hooks/slog/handler.go:132
↓ 1 callers
Function
WithContext
WithContext creates an entry from the standard logger and adds a context to it.
exported.go:62
↓ 1 callers
Function
WithError
WithError creates an entry from the standard logger and adds an error to it, using the value defined in [ErrorKey] as key.
exported.go:57
↓ 1 callers
Method
WithField
WithField allocates a new entry and adds a field to it. Debug, Print, Info, Warn, Error, Fatal or Panic must be then applied to this new returned entr
logger.go:124
↓ 1 callers
Method
Write
(p []byte)
logrus_test.go:712
↓ 1 callers
Method
WriterLevel
WriterLevel returns an io.Writer that can be used to write arbitrary text to the logger at the given log level. Each line written to the writer will b
writer.go:20
↓ 1 callers
Method
appendBytes
(b *bytes.Buffer, bs []byte)
text_formatter.go:396
↓ 1 callers
Method
appendKeyValue
appendKeyValue writes key=value. Keys are written verbatim (unquoted/unescaped); values are subject to quoting/escaping.
text_formatter.go:309
↓ 1 callers
Method
appendNumeric
(b *bytes.Buffer, out []byte)
text_formatter.go:411
↓ 1 callers
Method
appendString
(b *bytes.Buffer, s string)
text_formatter.go:381
↓ 1 callers
Function
caller1
go:noinline
entry_bench_test.go:132
↓ 1 callers
Function
caller2
go:noinline
entry_bench_test.go:129
↓ 1 callers
Function
caller3
go:noinline
entry_bench_test.go:126
↓ 1 callers
Function
caller4
go:noinline
entry_bench_test.go:123
↓ 1 callers
Function
doLoggerBenchmark
(b *testing.B, out *os.File, formatter logrus.Formatter, fields logrus.Fields)
logger_bench_test.go:32
↓ 1 callers
Function
doLoggerBenchmarkNoLock
(b *testing.B, out *os.File, formatter logrus.Formatter, fields logrus.Fields)
logger_bench_test.go:47
↓ 1 callers
Method
fireHooks
(hooks []Hook)
entry.go:380
↓ 1 callers
Function
formatLevel
(level Level, disableTrunc, pad bool, maxLen int)
level.go:40
↓ 1 callers
Method
getBufferPool
()
entry.go:373
↓ 1 callers
Function
getCaller
getCaller retrieves the name of the first non-logrus calling function
entry.go:253
↓ 1 callers
Function
getErr
(t *testing.T, e *logrus.Entry)
entry_test.go:361
↓ 1 callers
Function
getPackageName
getPackageName reduces a fully qualified function name to the package name There really ought to be a better way...
entry.go:238
↓ 1 callers
Function
hasLogrusLogger
hasLogrusLogger reports whether logger has already handled the current log record while it was forwarded through slog adapters.
hooks/slog/slog.go:34
↓ 1 callers
Method
hooksForLevel
hooksForLevel returns a snapshot of the hooks registered for the given level. The returned slice is a shallow copy and may be used without holding log
logger.go:422
↓ 1 callers
Function
isTerminal
(fd int)
terminal_check_bsd.go:9
↓ 1 callers
Method
isTerminal
(entry *Entry)
text_formatter.go:108
↓ 1 callers
Function
levelPrefix
(level Level, disableTrunc, pad bool)
level.go:85
↓ 1 callers
Function
logLoop
(iterations int, reportCaller bool)
logrus_test.go:483
↓ 1 callers
Function
logSomething
(t *testing.T, message string)
logrus_test.go:124
↓ 1 callers
Function
needsQuoting
needsQuoting returns true if the string contains any byte that requires quoting. It returns false when every byte is "safe" according to isSafeByte.
text_formatter.go:423
↓ 1 callers
Function
needsQuotingBytes
needsQuotingBytes returns true if the byte slice contains any byte that requires quoting. It returns false when every byte is "safe" according to isSa
text_formatter.go:437
↓ 1 callers
Method
printColored
(b *bytes.Buffer, entry *Entry, keys []string, data Fields)
text_formatter.go:248
↓ 1 callers
Method
printPlain
(b *bytes.Buffer, entry *Entry, keys []string, data Fields)
text_formatter.go:173
↓ 1 callers
Function
runEntryLoggerRace
(t *testing.T, mutate func(logger *logrus.Logger))
entry_test.go:426
↓ 1 callers
Function
runHandler
(handler func())
alt_exit.go:32
↓ 1 callers
Function
toLogrusLevel
toLogrusLevel maps a slog level using the default mapping.
hooks/slog/level.go:77
↓ 1 callers
Function
toSlogLevel
toSlogLevel maps a Logrus level using the default mapping.
hooks/slog/level.go:99
↓ 1 callers
Method
toSlogLevel
toSlogLevel maps a Logrus level using LevelMapper or the default mapping.
hooks/slog/slog.go:85
↓ 1 callers
Function
unsetEnv
unsetEnv calls [os.Unsetenv] to unset an environment variable if it is set, and uses t.Cleanup to restore the environment variable to its original val
text_formatter_test.go:522
↓ 1 callers
Function
withLogrusLogger
withLogrusLogger returns a context that records logger as having already handled the current log record.
hooks/slog/slog.go:22
↓ 1 callers
Method
write
()
entry.go:389
← previous
next →
101–200 of 506, ranked by callers