MCPcopy Create free account

hub / github.com/sirupsen/logrus / functions

Functions506 in github.com/sirupsen/logrus

↓ 64 callersFunctionNew
New Creates a new logger. Configuration should be set by changing [Formatter], Out and Hooks directly on the default Logger instance. You can also jus
logger.go:96
↓ 59 callersMethodInfo
(args ...any)
logrus.go:194
↓ 41 callersMethodSetOutput
SetOutput sets the logger output.
logger.go:448
↓ 34 callersMethodErrorf
(format string, args ...any)
logrus.go:209
↓ 30 callersMethodError
(args ...any)
logrus.go:208
↓ 30 callersMethodFatal
(args ...any)
logrus.go:155
↓ 28 callersMethodWithField
(key string, value any)
logrus.go:167
↓ 26 callersMethodString
String returns the string representation from the reader and ultimately the formatter.
entry.go:150
↓ 24 callersFunctionLogAndAssertJSON
(t *testing.T, log func(*logrus.Logger), assertions func(logrus.Fields))
internal/testutils/testutils.go:15
↓ 23 callersMethodAdd
Add a hook to an instance of logger. This is called with `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface.
hooks.go:18
↓ 19 callersFunctionNewEntry
NewEntry creates a new [Entry] associated with the provided Logger. The logger must not be nil. Passing a nil logger results in a panic when a logging
entry.go:100
↓ 19 callersMethodSetLevel
SetLevel sets the logger level.
logger.go:404
↓ 18 callersMethodAddHook
AddHook adds a hook to the logger hooks.
logger.go:414
↓ 18 callersMethodIsLevelEnabled
IsLevelEnabled checks if logging for the given level is enabled.
logger.go:436
↓ 18 callersFunctionWithField
WithField creates an entry from the standard logger and adds a single field. For multiple fields, prefer [WithFields] over chaining WithField calls.
exported.go:68
↓ 17 callersMethodFormat
Format renders a single log entry
json_formatter.go:70
↓ 17 callersMethodLog
Log logs a message at the specified level. Using Log with [PanicLevel] or [FatalLevel] intentionally does not trigger a panic or exit. Log treats the
entry.go:417
↓ 17 callersFunctionNewNullLogger
NewNullLogger creates a discarding logger and installs the test hook.
hooks/test/test.go:40
↓ 17 callersMethodnewEntry
()
logger.go:107
↓ 17 callersMethodreleaseEntry
(entry *Entry)
logger.go:115
↓ 16 callersMethodSetFormatter
SetFormatter sets the logger formatter.
logger.go:441
↓ 15 callersMethodFatalf
(format string, args ...any)
logrus.go:156
↓ 15 callersMethodLock
()
logger.go:68
↓ 15 callersMethodUnlock
()
logger.go:74
↓ 14 callersMethodLastEntry
LastEntry returns the last entry that was logged or nil.
hooks/test/test.go:59
↓ 14 callersFunctiondoBenchmark
(b *testing.B, formatter logrus.Formatter, fields logrus.Fields)
formatter_bench_test.go:144
↓ 13 callersMethodBytes
Bytes returns the bytes representation of this entry from the formatter.
entry.go:131
↓ 12 callersMethodFormat
Format renders a single log entry
text_formatter.go:146
↓ 11 callersMethodPrint
(args ...any)
logrus.go:151
↓ 10 callersMethodWarn
(args ...any)
logrus.go:201
↓ 10 callersMethodWithFields
(fields Fields)
logrus.go:168
↓ 9 callersMethodExit
(code int)
logger.go:384
↓ 9 callersMethodFormat
(*Entry)
formatter.go:40
↓ 9 callersMethodLogf
Entry Printf family functions Logf logs a formatted message at the specified level. Using Logf with [PanicLevel] or [FatalLevel] intentionally does n
entry.go:471
↓ 9 callersMethodLogln
Entry Println family functions Logln logs a message at the specified level with Println-style spacing. Using Logln with [PanicLevel] or [FatalLevel]
entry.go:525
↓ 7 callersMethodLog
Log logs a message at the specified level. Using Log with [PanicLevel] or [FatalLevel] intentionally does not trigger a panic or exit. Log treats the
logger.go:221
↓ 7 callersMethodLogFn
LogFn logs a message returned by fn at the specified level. Using LogFn with [PanicLevel] or [FatalLevel] intentionally does not trigger a panic or e
logger.go:234
↓ 7 callersMethodSetReportCaller
SetReportCaller sets whether the caller stack frame must be logged.
logger.go:455
↓ 7 callersMethodWithTime
WithTime overrides the time of the Entry.
entry.go:229
↓ 7 callersMethodWrite
(p []byte)
writer_test.go:50
↓ 7 callersMethoddup
dup copies the entry fields shared by derived entries except Data, which callers must copy or initialize as appropriate for their use.
entry.go:120
↓ 6 callersMethodLevel
()
hooks/slog/level.go:29
↓ 6 callersMethodLogf
Logf logs a formatted message at the specified level. Using Logf with [PanicLevel] or [FatalLevel] intentionally does not trigger a panic or exit. Lo
logger.go:165
↓ 6 callersMethodLogln
Logln logs a message at the specified level with Println-style spacing. Using Logln with [PanicLevel] or [FatalLevel] intentionally does not trigger
logger.go:333
↓ 6 callersMethodReset
Reset removes all Entries from this test hook.
hooks/test/test.go:83
↓ 6 callersMethodlog
log writes msg at level. If panicAfter is true, it panics with the fully populated entry after hooks and output have completed. The explicit flag kee
entry.go:327
↓ 6 callersFunctionskipReportCaller
(t *testing.T)
logrus_test.go:22
↓ 5 callersMethodInfo
(args ...any)
entry.go:436
↓ 5 callersMethodInfoln
(args ...any)
logrus.go:196
↓ 5 callersMethodPanic
(args ...any)
logrus.go:159
↓ 5 callersMethodWithContext
WithContext adds a context to the Entry.
entry.go:174
↓ 4 callersMethodAllEntries
AllEntries returns all entries that were logged.
hooks/test/test.go:70
↓ 4 callersMethodDebug
(args ...any)
logrus.go:187
↓ 4 callersMethodHandle
Handle converts the slog record into a logrus entry and logs it. Record time, context, message, and attributes (including those from [Handler.WithAttr
hooks/slog/handler.go:88
↓ 4 callersMethodReplaceHooks
ReplaceHooks replaces the logger hooks and returns the old ones
logger.go:462
↓ 4 callersMethodWithField
WithField adds a single field to the Entry.
entry.go:182
↓ 4 callersMethodWriter
Writer returns an io.Writer that writes to the logger at the info log level
writer.go:25
↓ 3 callersFunctionExit
Exit runs all the Logrus atexit handlers and then terminates the program using os.Exit(code)
alt_exit.go:49
↓ 3 callersMethodGet
()
buffer_pool.go:18
↓ 3 callersMethodPanicf
(format string, args ...any)
logrus.go:160
↓ 3 callersMethodPanicln
(args ...any)
logrus.go:161
↓ 3 callersMethodPrintln
(args ...any)
logrus.go:153
↓ 3 callersMethodPut
(*bytes.Buffer)
buffer_pool.go:17
↓ 3 callersFunctionStandardLogger
StandardLogger returns the package-level standard logger used by the top-level logging functions.
exported.go:15
↓ 3 callersMethodWithError
WithError adds an error as single field (using the key defined in [ErrorKey]) to the Entry.
entry.go:161
↓ 3 callersMethodWithFields
WithFields adds a map of fields to the Entry.
entry.go:201
↓ 3 callersMethodWriterLevel
WriterLevel returns an io.Writer that writes to the logger at the given log level
writer.go:30
↓ 3 callersFunctionassertFileContent
(t *testing.T, path, want string, childOut []byte)
alt_exit_test.go:112
↓ 3 callersFunctionreexecCommand
reexecCommand builds a command that execs the current test binary (exe) with argv0 set to token and "-test.run=<pattern>" so the child runs only this
alt_exit_test.go:157
↓ 3 callersFunctionreexecTest
reexecTest runs fn if this process is the child (argv0 == token). Returns true in the child (caller should return).
alt_exit_test.go:135
↓ 3 callersMethodresolve
(key fieldKey)
json_formatter.go:16
↓ 2 callersMethodErrorFn
(fn LogFunction)
logger.go:311
↓ 2 callersMethodFire
(*Entry)
hooks.go:10
↓ 2 callersMethodGetLevel
GetLevel returns the logger level.
logger.go:409
↓ 2 callersMethodInfoFn
(fn LogFunction)
logger.go:293
↓ 2 callersMethodInfof
(format string, args ...any)
logrus.go:195
↓ 2 callersFunctionLogAndAssertText
(t *testing.T, log func(*logrus.Logger), assertions func(fields map[string]string))
internal/testutils/testutils.go:30
↓ 2 callersFunctionNewGlobal
NewGlobal installs a test hook for the global logger.
hooks/test/test.go:24
↓ 2 callersFunctionNewLocal
NewLocal installs a test hook for a given local logger.
hooks/test/test.go:32
↓ 2 callersMethodPrintf
(format string, args ...any)
logrus.go:152
↓ 2 callersFunctionRegisterExitHandler
RegisterExitHandler appends a Logrus Exit handler to the list of handlers, call logrus.Exit to invoke all handlers. The handlers will also be invoked
alt_exit.go:62
↓ 2 callersMethodSetBufferPool
SetBufferPool sets the logger buffer pool.
logger.go:471
↓ 2 callersFunctionSetReportCaller
SetReportCaller sets whether the standard logger will include the calling method as a field.
exported.go:31
↓ 2 callersMethodString
Convert the Level to a string. E.g. [PanicLevel] becomes "panic".
logrus.go:18
↓ 2 callersMethodString
()
writer_test.go:62
↓ 2 callersMethodTrace
(args ...any)
logrus.go:215
↓ 2 callersMethodUnmarshalText
UnmarshalText implements encoding.TextUnmarshaler.
logrus.go:67
↓ 2 callersMethodWarnFn
(fn LogFunction)
logger.go:303
↓ 2 callersMethodWarning
Legacy warning aliases. These are kept on FieldLogger for backwards compatibility, but are intentionally omitted from [WarnLogger].
logrus.go:180
↓ 2 callersMethodWithError
(err error)
logrus.go:169
↓ 2 callersFunctionWithFields
WithFields creates an entry from the standard logger and adds the fields to it.
exported.go:73
↓ 2 callersMethodWithFields
WithFields adds a struct of fields to the log entry. It calls [Entry.WithField] for each Field.
logger.go:132
↓ 2 callersMethodWithGroup
WithGroup returns a new Handler with a group appended to the receiver's existing groups. All attributes added to the returned handler (via WithAttrs o
hooks/slog/handler.go:151
↓ 2 callersFunctionappendAttr
appendAttr adds attr to fields, resolving it and applying group prefixes. Group attributes are flattened with "."-separated keys.
hooks/slog/handler.go:173
↓ 2 callersFunctionappendLine
(path, s string)
alt_exit_test.go:99
↓ 2 callersMethodappendValue
(b *bytes.Buffer, value any)
text_formatter.go:318
↓ 2 callersFunctionargv0Token
argv0Token computes a short deterministic token for (t.Name(), name).
alt_exit_test.go:128
↓ 2 callersFunctionbenchmarkEntryInfo
(b *testing.B, reportCaller bool)
entry_bench_test.go:97
↓ 2 callersFunctionbenchmarkEntryReportCallerDepth4
benchmarkEntryReportCallerDepth4 simulates a wrapper call site. It does not increase getCaller() scan depth (which stops at the first non-logrus frame
entry_bench_test.go:138
↓ 2 callersFunctioncheckIfTerminal
(w io.Writer)
terminal_check_windows.go:12
next →1–100 of 506, ranked by callers