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

# Packages

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

# Functions

DecodeStackTrace produces a stack trace from the encoded string.
DirSet returns true of the log directory 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.
EncodeStackTrace produces a decodable string representation of the stack trace.
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'.
ErrorSource attempts to return the file:line where `i` was created if `i` has that information (i.e.
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 os.Exit(255).
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 os.Exit(255).
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 os.Exit(255).
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 flushes all pending log I/O.
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.
InfoDepth logs to the INFO log, offsetting the caller's stack frame by 'depth'.
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`.
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 are visible on stderr.
MakeEntry creates an Entry.
MakeFileInfo constructs a FileInfo from FileDetails and os.FileInfo.
MakeMessage creates a structured log entry.
NewEntryDecoder creates a new instance of EntryDecoder.
NewSecondaryLogger creates a secondary logger.
NewStackTrace generates a stacktrace suitable for inclusion in error reports.
NewStdLogger creates a *stdLog.Logger that forwards messages to the CockroachDB logs with the specified severity.
ParseLogFilename parses a filename into FileDetails if it matches the pattern for log files.
PrintStackTrace produces a human-readable partial representation of the stack trace.
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.
Redact returns a redacted version of the supplied item that is safe to use in anonymized reporting.
RegisterTagFn adds a function for tagging crash reports based on the context.
ReportablesToSafeError inspects the given format string (taken as not needing redaction) and reportables, redacts them appropriately and returns an error that is safe to pass to anonymized reporting.
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.
Safe constructs a SafeType.
Scope creates a TestLogScope which corresponds to the lifetime of a logging directory.
ScopeWithoutShowLogs ignores the -show-logs flag and should be used for tests that require the logs go to files.
SendCrashReport posts to sentry.
SendReport uploads a detailed error report to sentry.
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.
SetSync configures whether logging synchronizes all writes.
SetupCrashReporter sets the crash reporter info.
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.
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.
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.
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.
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

# 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.
PanicOnAssertions wraps "debug.panic_on_failed_assertions".
ReportSensitiveDetails enables reporting of unanonymized data.
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.
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
A SafeType panic can be reported verbatim, i.e.
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.

# Interfaces

SafeMessager is implemented by objects which have a way of representing themselves suitably redacted for anonymized reporting.

# Type aliases

InterceptorFn is the type of function accepted by Intercept().
ReportableObject is an interface suitable for the extra detail objects provided to SendReport().
ReportType is used to differentiate between an actual crash/panic and just reporting an error.
No description provided by the author
StackTrace is an object suitable for inclusion in errors that can ultimately be reported with ReportInternalError() or similar.