Skip to content

Commit cde9be5

Browse files
committed
change: to public
1 parent a434c26 commit cde9be5

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

context.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ package stalog
22

33
type contextKey struct{}
44

5-
var (
6-
contextLoggerKey = &contextKey{}
7-
)
5+
var ContextLoggerKey = &contextKey{}

middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func NewReserve(config *Config, r *http.Request) *Reserve {
9999
loggedSeverity: make([]Severity, 0, 10),
100100
Skip: config.Skip,
101101
}
102-
ctx := context.WithValue(r.Context(), contextLoggerKey, contextLogger)
102+
ctx := context.WithValue(r.Context(), ContextLoggerKey, contextLogger)
103103

104104
return &Reserve{
105105
before: before,

stackdriver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type ContextLogger struct {
112112
// RequestContextLogger gets request-context logger for the request.
113113
// You must use `RequestLogging` middleware in advance for this function to work.
114114
func RequestContextLogger(r *http.Request) *ContextLogger {
115-
v, _ := r.Context().Value(contextLoggerKey).(*ContextLogger)
115+
v, _ := r.Context().Value(ContextLoggerKey).(*ContextLogger)
116116
return v
117117
}
118118

0 commit comments

Comments
 (0)