summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-04-25 23:47:47 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-04-25 23:47:47 -0400
commit027bcb726ea5e37d9fb3040419e9f079cdbb0ce3 (patch)
tree63814bdf1398c8891eb4faa0ade38bdc08ff5573
parentdfe22c5b083443ed00df9431cbd3cd7a7b4fd6a7 (diff)
Improve godoc
This had apparently been sitting here uncommitted since Jan 1.
-rw-r--r--nslcd_server/ctx.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/nslcd_server/ctx.go b/nslcd_server/ctx.go
index 9722017..f80c930 100644
--- a/nslcd_server/ctx.go
+++ b/nslcd_server/ctx.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2017 Luke Shumaker <lukeshu@sbcglobal.net>
+// Copyright (C) 2017-2018 Luke Shumaker <lukeshu@sbcglobal.net>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@ -25,8 +25,8 @@ import (
)
// Logger is the common interface between
-// `"git.lukeshu.com/go/libsystemd/sd_daemon".Logger` and
-// `"log/syslog".Writer`.
+// "git.lukeshu.com/go/libsystemd/sd_daemon".Logger and
+// "log/syslog".Writer.
type Logger interface {
Emerg(m string) error
Alert(m string) error
@@ -67,6 +67,8 @@ func PeerCredFromContext(ctx context.Context) (unix.Ucred, bool) {
return cred, ok
}
+// LoggerFromcontext returns the value associated with LoggerKey, or
+// an Stderr logger if there is no value associated with LoggerKey.
func LoggerFromContext(ctx context.Context) Logger {
logger, ok := ctx.Value(LoggerKey).(Logger)
if !ok {