Documentation
¶
Overview ¶
Package logging is the service's log: JSON lines on one stream, in the keys Cloud Logging reads, held to the table of events in events.go.
Every line goes through guard, which writes only what the table allows. So the rule that the log carries no direct identifier, IP address, work, reading or hint text (R09 spec; privacy 4 spec) does not rest on each line's author remembering it: a field the table does not give the event is dropped and counted, and an event the table does not know loses its message. The libraries in the process — tutor, module-kit and the rest — are handed this same *slog.Logger, and their lines pass the same guard.
Index ¶
Constants ¶
const ( // EventStartup is the line that says a revision has started, and which // build it runs. The delivery finds a revision's release by it. EventStartup = "startup" // EventStopping is the line that says a stop was asked for. EventStopping = "stopping" // EventStopped is the line that says the server has drained. EventStopped = "stopped" // EventShutdown is the last line of a process that stopped as asked. EventShutdown = "shutdown" // EventFailure is a failure nobody asked for, at a moment of the closed set // the field moment names. EventFailure = "failure" // EventPanic is a panic a handler raised and the server recovered. EventPanic = "panic" // EventMigrated is the line that says the migrations ran: how many it applied, // and the version the schema is at. EventMigrated = "migrated" )
The events of the service's own lines.
const ( FieldVersion = "version" FieldCommit = "commit" FieldDate = "date" FieldPort = "port" FieldDeployed = "deployed" FieldStarted = "started" FieldCutShort = "cut_short" FieldMoment = "moment" FieldErrorKind = "error_kind" FieldPanicKind = "panic_kind" FieldApplied = "applied" FieldSchemaVersion = "schema_version" )
The fields.
const ( MomentStartup = "startup" MomentServe = "serve" MomentShutdown = "shutdown" MomentMigrate = "migrate" )
The moments of a failure: the value set of FieldMoment.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Kind ¶
type Kind struct {
// contains filtered or unexported fields
}
Kind names what an error or a panic is, and none of what it carries: its text may hold a path, an address, a value from a request. Only ErrorKind and PanicKind make one, and the table accepts no other value for the fields error_kind and panic_kind.
func ErrorKind ¶
ErrorKind names an error by its chain, outermost first: the type of each link, a sentinel of the standard library by its name, and an errno of the system in the system's own words, which hold no data. The text of any other link is not written, since an error made by fmt.Errorf holds whatever its author formatted into it.
func PanicKind ¶
PanicKind names what a panic was raised with. A fault of the Go runtime is put in the runtime's own words, found inside whatever wrapped it, because those words hold types and numbers and no data. Anything else is a value of ours or a library's, which may hold a task, an answer or an image, so only its type is written.