forked from NdoleStudio/httpsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.go
More file actions
38 lines (27 loc) · 981 Bytes
/
logger.go
File metadata and controls
38 lines (27 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package telemetry
import (
"go.opentelemetry.io/otel/trace"
)
// Logger is an interface for creating customer logger implementations
type Logger interface {
// Error logs an error
Error(err error)
// WithService creates a new structured logger instance with a service name
WithService(string) Logger
// WithString creates a new structured logger instance with a string
WithString(key string, value string) Logger
// WithSpan creates a new structured logger instance for a spanContext
WithSpan(span trace.SpanContext) Logger
// Trace logs a new message with trace level.
Trace(value string)
// Info logs a new message with information level.
Info(value string)
// Warn logs a new message with warning level.
Warn(err error)
// Debug logs a new message with debug level.
Debug(value string)
// Fatal logs a new message with fatal level.
Fatal(err error)
// Printf makes the logger compatible with retryablehttp.Logger
Printf(string, ...interface{})
}