Documentation ¶
Index ¶
- func Criticalf(ctx context.Context, format string, a ...interface{})
- func Errorf(ctx context.Context, format string, a ...interface{})
- func Infof(ctx context.Context, format string, a ...interface{})
- func SetLogLabel(label string)
- func Warningf(ctx context.Context, format string, a ...interface{})
- type Span
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Criticalf ¶
Criticalf is like Infof, but the severity is critical level.
Example ¶
parent := context.Background() s := trace.SpanFromContext(parent) ctx := trace.ContextWithSpan(parent, s) Criticalf(ctx, "%s", "test")
Output: {"severity":"CRITICAL","message":"test","trace":"service/slslog/trace/00000000000000000000000000000000","span":"service/slslog/span/0000000000000000"}
func Errorf ¶
Errorf is like Infof, but the severity is error level.
Example ¶
parent := context.Background() s := trace.SpanFromContext(parent) ctx := trace.ContextWithSpan(parent, s) Errorf(ctx, "%s", "test")
Output: {"severity":"ERROR","message":"test","trace":"service/slslog/trace/00000000000000000000000000000000","span":"service/slslog/span/0000000000000000"}
func Infof ¶
Infof formats its arguments according to the format like fmt.Printf, and records the text as log message at Info level.
Example ¶
parent := context.Background() s := trace.SpanFromContext(parent) ctx := trace.ContextWithSpan(parent, s) Infof(ctx, "%s", "test")
Output: {"severity":"INFO","message":"test","trace":"service/slslog/trace/00000000000000000000000000000000","span":"service/slslog/span/0000000000000000"}
func SetLogLabel ¶
func SetLogLabel(label string)
func Warningf ¶
Warningf is like Infof, but the severity is warning level.
Example ¶
parent := context.Background() s := trace.SpanFromContext(parent) ctx := trace.ContextWithSpan(parent, s) Warningf(ctx, "%s", "test")
Output: {"severity":"WARNING","message":"test","trace":"service/slslog/trace/00000000000000000000000000000000","span":"service/slslog/span/0000000000000000"}
Types ¶
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span wraps go.opentelemetry.io/otel/trace.Span.
func StartSpan ¶
StartSpan starts a new span from the current span in the given context and returns it as Span. This span can be propagated to the subsequent process by using span's context.
Click to show internal directories.
Click to hide internal directories.