Standard library / log/slog
slog.Record
Event containing time, level, message, source PC and attributes. Clone before modifying a copied record. Expected stdout: 'ready\n'.
Formal Syntax & Structure
go syntaxgo
type Record struct { Time time.Time
Message string
Level Level
PC uintptr
}Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog" "time")
func main() { r := slog.NewRecord(time.Time{}, slog.LevelInfo, "ready", 0); fmt.Println(r.Message) }