package
20.2.19+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

DirSet returns true of the log directory for the main logger has been changed from its default.
DisableTracebacks turns off tracebacks for log.Fatals.
DumpStacks produces a dump of the stack traces in the logging output.
Error logs to the ERROR, WARNING, and INFO logs.
Errorf logs to the ERROR, WARNING, and INFO logs.
ErrorfDepth logs to the ERROR, WARNING, and INFO logs, offsetting the caller's stack frame by 'depth'.
Event looks for an opentracing.Trace in the context and logs the given message to it.
Eventf looks for an opentracing.Trace in the context and formats and logs the given message to it.
Every is a convenience constructor for an EveryN object that allows a log message every n duration.
ExpensiveLogEnabled is used to test whether effort should be used to produce log messages whose construction has a measurable cost.
Fatal logs to the INFO, WARNING, ERROR, and FATAL logs, including a stack trace of all running goroutines, then calls exit.WithCode(exit.FatalError()).
FatalChan is closed when Fatal is called.
Fatalf logs to the INFO, WARNING, ERROR, and FATAL logs, including a stack trace of all running goroutines, then calls exit.WithCode(exit.FatalError()).
FatalfDepth logs to the INFO, WARNING, ERROR, and FATAL logs (offsetting the caller's stack frame by 'depth'), including a stack trace of all running goroutines, then calls exit.WithCode(exit.FatalError()).
FatalOnPanic recovers from a panic and exits the process with a Fatal log.
FetchEntriesFromFiles fetches all available log entries on disk that are between the 'startTimestamp' and 'endTimestamp'.
FinishEventLog closes the event log in the context (see WithEventLog).
Flush explicitly flushes all pending log I/O.
FormatWithContextTags formats the string and prepends the context tags.
GetLogReader returns a reader for the specified filename.
HasSpanOrEvent returns true if the context has a span or event that should be logged to.
Info logs to the INFO log.
Infof logs to the INFO log.
InfofDepth logs to the INFO log, offsetting the caller's stack frame by 'depth'.
Intercept diverts log traffic to the given function `f`.
IsActive returns true iff the main logger already has some events logged, or some secondary logger was created with configuration taken from the main logger.
ListLogFiles returns a slice of FileInfo structs for each log file on the local node, in any of the configured log directories.
LoggingToStderr returns true if log messages of the given severity sent to the main logger are also visible on stderr.
MakeEntry creates an Entry.
MakeFileInfo constructs a FileInfo from FileDetails and os.FileInfo.
NewEntryDecoder creates a new instance of EntryDecoder.
NewSecondaryLogger creates a secondary logger.
NewStdLogger creates a *stdLog.Logger that forwards messages to the CockroachDB logs with the specified severity.
PanicAsError turns r into an error if it is not one already.
ParseLogFilename parses a filename into FileDetails if it matches the pattern for log files.
RecoverAndReportNonfatalPanic is an alternative RecoverAndReportPanic that does not re-panic in Release builds.
RecoverAndReportPanic can be invoked on goroutines that run with stderr redirected to logs to ensure the user gets informed on the real stderr a panic has occurred.
RedactableLogsEnabled reports whether redaction markers were actually enabled for the main logger.
RegisterTagFn adds a function for tagging crash reports based on the context.
ReportOrPanic either reports an error to sentry, if run from a release binary, or panics, if triggered in tests.
ReportPanic reports a panic has occurred on the real stderr.
ResetExitFunc undoes any prior call to SetExitFunc.
Scope creates a TestLogScope which corresponds to the lifetime of a temporary logging directory.
ScopeWithoutShowLogs creates a TestLogScope which corresponds to the lifetime of a temporary logging directory.
SelectEditMode returns an EditSensitiveData value that's suitable for use with NewDecoder depending on client-side desired "redact" and "keep redactable" flags.
SendReport uploads a detailed error report to sentry.
SetAlwaysFlush configures whether logging flushes all writes.
SetClusterID stores the cluster ID for further reference.
SetExitFunc allows setting a function that will be called to exit the process when a Fatal message is generated.
SetTenantIDs stores the tenant ID and instance ID for further reference.
SetupCrashReporter sets the crash reporter info.
SetupRedactionAndStderrRedirects should be called once after command-line flags have been parsed, and before the first log entry is emitted.
SetVModule alters the vmodule logging level to the passed in value.
SeverityByName attempts to parse the passed in string into a severity.
ShouldSendReport returns true iff SendReport() should be called.
Shout logs to the specified severity's log, and also to the real stderr if logging is currently redirected to a file.
Shoutf is like Shout but uses formatting.
StartGCDaemon starts the log file GC -- this must be called after command-line parsing has completed so that no data is lost when the user configures larger max sizes than the defaults.
TestingClearServerIdentifiers clears the server identity from the logging system.
TestingResetActive clears the active bit.
TestingSetRedactable sets the redactable flag for usage in a test.
V returns true if the logging verbosity is set to the specified level or higher.
VDepth reports whether verbosity at the call site is at least the requested level.
VErrEvent either logs an error message to the log files (which also outputs to the active trace or event log) or to the trace/event log alone, depending on whether the specified verbosity level is active.
VErrEventf either logs an error message to the log files (which also outputs to the active trace or event log) or to the trace/event log alone, depending on whether the specified verbosity level is active.
VErrEventfDepth performs the same as VErrEventf but checks the verbosity level at the given depth in the call stack.
VEvent either logs a message to the log files (which also outputs to the active trace or event log) or to the trace/event log alone, depending on whether the specified verbosity level is active.
VEventf either logs a message to the log files (which also outputs to the active trace or event log) or to the trace/event log alone, depending on whether the specified verbosity level is active.
VEventfDepth performs the same as VEventf but checks the verbosity level at the given depth in the call stack.
VInfof logs to the INFO log depending on whether the specified verbosity level is active.
Warning logs to the WARNING and INFO logs.
Warningf logs to the WARNING and INFO logs.
WarningfDepth logs to the WARNING and INFO logs, offsetting the caller's stack frame by 'depth'.
WithEventLog creates and embeds a trace.EventLog in the context, causing future logging and event calls to go to the EventLog.
WithNoEventLog creates a context which no longer has an embedded event log.

# Constants

FileNamePattern matches log files to avoid exposing non-log files accidentally and it splits the details of the filename into groups for easy parsing.
FilePattern matches log file paths.
FileTimeFormat is RFC3339 with the colons replaced with underscores.
MessageTimeFormat is the format of the timestamp in log message headers as used in time.Parse and time.Format.
ReportTypeError signifies that this is just a report of an error but it still may include an exception and stack trace.
ReportTypeLogFatal signifies that this is an error report that was generated via a log.Fatal call.
ReportTypePanic signifies that this is an actual panic.
DEFAULT is the end sentinel.
No description provided by the author
No description provided by the author
No description provided by the author
NONE is used to specify when no messages should be printed to the log file or stderr.
No description provided by the author
No description provided by the author
WithFlattenedSensitiveData is the log with markers stripped.
WithMarkedSensitiveData is the "raw" log with sensitive data markers included.
WithoutSensitiveData is the log with the sensitive data redacted.

# Variables

CrashReports wraps "diagnostics.reporting.send_crash_reports".
DiagnosticsReportingEnabled wraps "diagnostics.reporting.enabled".
No description provided by the author
No description provided by the author
10MiB.
100MiB.
OrigStderr points to the original stderr stream when the process started.
PanicOnAssertions wraps "debug.panic_on_failed_assertions".
ReportSensitiveDetails enables reporting of unanonymized data.
Safe constructs a SafeFormatter / SafeMessager.
No description provided by the author
No description provided by the author

# Structs

AmbientContext is a helper type used to "annotate" context.Contexts with log tags and a Tracer or EventLog.
DirName overrides (if non-empty) the choice of directory in which to write logs.
Entry
Entry represents a cockroach structured log entry.
EntryCounter supports the generation of a per-entry log entry counter.
EntryDecoder reads successive encoded log entries from the input buffer.
EveryN provides a way to rate limit spammy log messages.
A FileDetails holds all of the particulars that can be parsed by the name of a log file.
No description provided by the author
SecondaryLogger represents a secondary / auxiliary logging channel whose logging events go to a different file than the main logging facility.
TestLogScope represents the lifetime of a logging output.

# Type aliases

EditSensitiveData describes how the messages in log entries should be edited through the API.
InterceptorFn is the type of function accepted by Intercept().
Level specifies a level of verbosity for V logs.
ReportType is used to differentiate between an actual crash/panic and just reporting an error.
No description provided by the author