summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-14 09:08:13 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-14 09:08:13 -0600
commit6d6cada0970a2b341f36dac9b0fed8262ada1865 (patch)
treefc3728f15deaebd0c870838a63735659a33456e7 /Godeps/_workspace/src/code.google.com/p/log4go/termlog.go
parent0b986ed3147c885af6b2f33e1ff3eb6754e8f274 (diff)
parenta341dbad2b8a4564b6f270c79f2f9932e499ac80 (diff)
downloadchat-6d6cada0970a2b341f36dac9b0fed8262ada1865.tar.gz
chat-6d6cada0970a2b341f36dac9b0fed8262ada1865.tar.bz2
chat-6d6cada0970a2b341f36dac9b0fed8262ada1865.zip
Merge branch 'master' into PLT-1429
Diffstat (limited to 'Godeps/_workspace/src/code.google.com/p/log4go/termlog.go')
-rw-r--r--Godeps/_workspace/src/code.google.com/p/log4go/termlog.go45
1 files changed, 0 insertions, 45 deletions
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go b/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go
deleted file mode 100644
index 1ed2e4e0d..000000000
--- a/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (C) 2010, Kyle Lemons <kyle@kylelemons.net>. All rights reserved.
-
-package log4go
-
-import (
- "io"
- "os"
- "fmt"
-)
-
-var stdout io.Writer = os.Stdout
-
-// This is the standard writer that prints to standard output.
-type ConsoleLogWriter chan *LogRecord
-
-// This creates a new ConsoleLogWriter
-func NewConsoleLogWriter() ConsoleLogWriter {
- records := make(ConsoleLogWriter, LogBufferLength)
- go records.run(stdout)
- return records
-}
-
-func (w ConsoleLogWriter) run(out io.Writer) {
- var timestr string
- var timestrAt int64
-
- for rec := range w {
- if at := rec.Created.UnixNano() / 1e9; at != timestrAt {
- timestr, timestrAt = rec.Created.Format("01/02/06 15:04:05"), at
- }
- fmt.Fprint(out, "[", timestr, "] [", levelStrings[rec.Level], "] ", rec.Message, "\n")
- }
-}
-
-// This is the ConsoleLogWriter's output method. This will block if the output
-// buffer is full.
-func (w ConsoleLogWriter) LogWrite(rec *LogRecord) {
- w <- rec
-}
-
-// Close stops the logger from sending messages to standard output. Attempts to
-// send log messages to this logger after a Close have undefined behavior.
-func (w ConsoleLogWriter) Close() {
- close(w)
-}