diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-07-13 10:29:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 10:29:50 -0400 |
commit | 17f211c393772f30922bac595592e3fe60c2ef25 (patch) | |
tree | 4f8dfbe7949022d5da2de2db6d7b762e74fb4582 /plugin/hclog_adapter.go | |
parent | 5ddb08dcb47f938c9ac3a3e6338d9b3cc61c20a7 (diff) | |
download | chat-17f211c393772f30922bac595592e3fe60c2ef25.tar.gz chat-17f211c393772f30922bac595592e3fe60c2ef25.tar.bz2 chat-17f211c393772f30922bac595592e3fe60c2ef25.zip |
MM-11292: clean up plugins GoDoc (#9109)
* clean up plugins GoDoc:
- eliminate plugin.NewBlankContext() as unnecessary
- export ValidIdRegex as a string vs. the less readable var
- add/update various documentation strings
- hide everything by default, except where used by client plugins or the mattermost-server. The exception to this rule are the `*(Args|Returns)` structs which must be public for go-plugin, but are now prefixed with `Z_` with a warning not to use.
- include a top-level example to get plugin authors started
This is not a breaking change for existing plugins compiled against
plugins-v2.
* remove commented out ServeHTTPResponseWriter
* update examples to match developer docs
* add missing plugin/doc.go license header
Diffstat (limited to 'plugin/hclog_adapter.go')
-rw-r--r-- | plugin/hclog_adapter.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugin/hclog_adapter.go b/plugin/hclog_adapter.go index 55d60f508..64b1e5243 100644 --- a/plugin/hclog_adapter.go +++ b/plugin/hclog_adapter.go @@ -12,12 +12,12 @@ import ( "github.com/mattermost/mattermost-server/mlog" ) -type HclogAdapter struct { +type hclogAdapter struct { wrappedLogger *mlog.Logger extrasKey string } -func (h *HclogAdapter) Trace(msg string, args ...interface{}) { +func (h *hclogAdapter) Trace(msg string, args ...interface{}) { extras := strings.TrimSpace(fmt.Sprint(args...)) if extras != "" { h.wrappedLogger.Debug(msg, mlog.String(h.extrasKey, extras)) @@ -26,7 +26,7 @@ func (h *HclogAdapter) Trace(msg string, args ...interface{}) { } } -func (h *HclogAdapter) Debug(msg string, args ...interface{}) { +func (h *hclogAdapter) Debug(msg string, args ...interface{}) { extras := strings.TrimSpace(fmt.Sprint(args...)) if extras != "" { h.wrappedLogger.Debug(msg, mlog.String(h.extrasKey, extras)) @@ -35,7 +35,7 @@ func (h *HclogAdapter) Debug(msg string, args ...interface{}) { } } -func (h *HclogAdapter) Info(msg string, args ...interface{}) { +func (h *hclogAdapter) Info(msg string, args ...interface{}) { extras := strings.TrimSpace(fmt.Sprint(args...)) if extras != "" { h.wrappedLogger.Info(msg, mlog.String(h.extrasKey, extras)) @@ -44,7 +44,7 @@ func (h *HclogAdapter) Info(msg string, args ...interface{}) { } } -func (h *HclogAdapter) Warn(msg string, args ...interface{}) { +func (h *hclogAdapter) Warn(msg string, args ...interface{}) { extras := strings.TrimSpace(fmt.Sprint(args...)) if extras != "" { h.wrappedLogger.Warn(msg, mlog.String(h.extrasKey, extras)) @@ -53,7 +53,7 @@ func (h *HclogAdapter) Warn(msg string, args ...interface{}) { } } -func (h *HclogAdapter) Error(msg string, args ...interface{}) { +func (h *hclogAdapter) Error(msg string, args ...interface{}) { extras := strings.TrimSpace(fmt.Sprint(args...)) if extras != "" { h.wrappedLogger.Error(msg, mlog.String(h.extrasKey, extras)) @@ -62,38 +62,38 @@ func (h *HclogAdapter) Error(msg string, args ...interface{}) { } } -func (h *HclogAdapter) IsTrace() bool { +func (h *hclogAdapter) IsTrace() bool { return false } -func (h *HclogAdapter) IsDebug() bool { +func (h *hclogAdapter) IsDebug() bool { return true } -func (h *HclogAdapter) IsInfo() bool { +func (h *hclogAdapter) IsInfo() bool { return true } -func (h *HclogAdapter) IsWarn() bool { +func (h *hclogAdapter) IsWarn() bool { return true } -func (h *HclogAdapter) IsError() bool { +func (h *hclogAdapter) IsError() bool { return true } -func (h *HclogAdapter) With(args ...interface{}) hclog.Logger { +func (h *hclogAdapter) With(args ...interface{}) hclog.Logger { return h } -func (h *HclogAdapter) Named(name string) hclog.Logger { +func (h *hclogAdapter) Named(name string) hclog.Logger { return h } -func (h *HclogAdapter) ResetNamed(name string) hclog.Logger { +func (h *hclogAdapter) ResetNamed(name string) hclog.Logger { return h } -func (h *HclogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger { +func (h *hclogAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger { return h.wrappedLogger.StdLog() } |