diff options
author | George Goldberg <george@gberg.me> | 2018-03-13 13:36:23 +0000 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-03-13 13:36:23 +0000 |
commit | fadcdd271a68b38571b75d1d38ab023f940ac83a (patch) | |
tree | 7f413edd35401b54b2f4eb4a687da1ac273bcd4b /utils/log.go | |
parent | b66e4bc932ed76c1cfd2b5f4ec0cfce70cd9fbb4 (diff) | |
parent | f2d26801b9647715fb43af873354d8def753868b (diff) | |
download | chat-fadcdd271a68b38571b75d1d38ab023f940ac83a.tar.gz chat-fadcdd271a68b38571b75d1d38ab023f940ac83a.tar.bz2 chat-fadcdd271a68b38571b75d1d38ab023f940ac83a.zip |
Merge branch 'master' into advanced-permissions-phase-1
Diffstat (limited to 'utils/log.go')
-rw-r--r-- | utils/log.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/utils/log.go b/utils/log.go deleted file mode 100644 index c1f579e9d..000000000 --- a/utils/log.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package utils - -import ( - "bytes" - "io" - "io/ioutil" - - l4g "github.com/alecthomas/log4go" -) - -// InfoReader logs the content of the io.Reader and returns a new io.Reader -// with the same content as the received io.Reader. -// If you pass reader by reference, it won't be re-created unless the loglevel -// includes Debug. -// If an error is returned, the reader is consumed an cannot be read again. -func InfoReader(reader io.Reader, message string) (io.Reader, error) { - var err error - l4g.Info(func() string { - content, err := ioutil.ReadAll(reader) - if err != nil { - return "" - } - - reader = bytes.NewReader(content) - - return message + string(content) - }) - - return reader, err -} |