package log
import "golang.org/x/pkgsite/internal/log"
Package log supports structured and unstructured logging with levels.
Index ¶
- Constants
- func Debug(ctx context.Context, arg any)
- func Debugf(ctx context.Context, format string, args ...any)
- func Error(ctx context.Context, arg any)
- func Errorf(ctx context.Context, format string, args ...any)
- func Fatal(ctx context.Context, arg any)
- func Fatalf(ctx context.Context, format string, args ...any)
- func Info(ctx context.Context, arg any)
- func Infof(ctx context.Context, format string, args ...any)
- func SetLevel(v string)
- func Use(l Logger)
- func Warning(ctx context.Context, arg any)
- func Warningf(ctx context.Context, format string, args ...any)
- type Logger
- type Severity
Constants ¶
const ( SeverityDefault = Severity(iota) SeverityDebug SeverityInfo SeverityWarning SeverityError SeverityCritical )
Functions ¶
func Debug ¶
Debug logs arg, which can be a string or a struct, at the Debug level.
func Debugf ¶
Debugf logs a formatted string at the Debug level.
func Error ¶
Error logs arg, which can be a string or a struct, at the Error level.
func Errorf ¶
Errorf logs a formatted string at the Error level.
func Fatal ¶
Fatal logs arg, which can be a string or a struct, at the Critical level followed by exiting the program.
func Fatalf ¶
Fatalf logs formatted string at the Critical level followed by exiting the program.
func Info ¶
Info logs arg, which can be a string or a struct, at the Info level.
func Infof ¶
Infof logs a formatted string at the Info level.
func SetLevel ¶
func SetLevel(v string)
Set the log level
func Use ¶
func Use(l Logger)
func Warning ¶
Warning logs arg, which can be a string or a struct, at the Warning level.
func Warningf ¶
Warningf logs a formatted string at the Warning level.
Types ¶
type Logger ¶
type Severity ¶
type Severity int
func (Severity) String ¶
Source Files ¶
log.go
Directories ¶
Path | Synopsis |
---|---|
internal/log/stackdriverlogger | Package log supports structured and unstructured logging with levels to GCP stackdriver. |
- Version
- v0.0.0-20250218150137-224a1368cf02 (latest)
- Published
- Feb 18, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 2 months ago –
Tools for package owners.