summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Godeps/Godeps.json5
-rw-r--r--Godeps/_workspace/src/code.google.com/p/log4go/.hgtags4
-rw-r--r--Godeps/_workspace/src/code.google.com/p/log4go/log4go_test.go534
-rw-r--r--Godeps/_workspace/src/code.google.com/p/log4go/termlog.go45
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/.gitignore2
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/LICENSE (renamed from Godeps/_workspace/src/code.google.com/p/log4go/LICENSE)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/README (renamed from Godeps/_workspace/src/code.google.com/p/log4go/README)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/config.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/config.go)4
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/examples/ConsoleLogWriter_Manual.go)1
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/examples/FileLogWriter_Manual.go)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/examples/SimpleNetLogServer.go)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/examples/SocketLogWriter_Manual.go)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/examples/XMLConfigurationExample.go)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/examples/example.xml (renamed from Godeps/_workspace/src/code.google.com/p/log4go/examples/example.xml)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/filelog.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/filelog.go)53
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/log4go.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/log4go.go)32
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/pattlog.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/pattlog.go)8
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/socklog.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/socklog.go)0
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/termlog.go49
-rw-r--r--Godeps/_workspace/src/github.com/alecthomas/log4go/wrapper.go (renamed from Godeps/_workspace/src/code.google.com/p/log4go/wrapper.go)10
-rw-r--r--api/admin.go2
-rw-r--r--api/api.go2
-rw-r--r--api/channel.go2
-rw-r--r--api/command.go2
-rw-r--r--api/context.go2
-rw-r--r--api/file.go2
-rw-r--r--api/import.go2
-rw-r--r--api/oauth.go2
-rw-r--r--api/post.go2
-rw-r--r--api/preference.go2
-rw-r--r--api/server.go2
-rw-r--r--api/slackimport.go2
-rw-r--r--api/team.go2
-rw-r--r--api/user.go2
-rw-r--r--api/web_conn.go2
-rw-r--r--api/web_hub.go2
-rw-r--r--api/web_socket.go2
-rw-r--r--api/web_team_hub.go2
-rw-r--r--api/webhook.go2
-rw-r--r--config/config.json8
-rw-r--r--doc/developer/tests/test-markdown-basics.md14
-rw-r--r--docker/1.4/Dockerfile49
-rw-r--r--docker/1.4/Dockerrun.aws.zipbin0 -> 1043 bytes
-rw-r--r--docker/1.4/Dockerrun.aws/.ebextensions/01_files.config14
-rwxr-xr-xdocker/1.4/Dockerrun.aws/Dockerrun.aws.json13
-rw-r--r--docker/1.4/README.md23
-rw-r--r--docker/1.4/config_docker.json111
-rwxr-xr-xdocker/1.4/docker-entry.sh111
-rw-r--r--manualtesting/manual_testing.go2
-rw-r--r--manualtesting/test_autolink.go2
-rw-r--r--mattermost.go2
-rw-r--r--model/client.go2
-rw-r--r--model/version.go1
-rw-r--r--store/sql_preference_store.go2
-rw-r--r--store/sql_session_store.go2
-rw-r--r--store/sql_store.go2
-rw-r--r--store/store.go2
-rw-r--r--utils/config.go6
-rw-r--r--utils/mail.go2
-rw-r--r--web/react/components/admin_console/email_settings.jsx4
-rw-r--r--web/web.go2
61 files changed, 496 insertions, 663 deletions
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index bd2392f90..d9c4a61bd 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -3,9 +3,8 @@
"GoVersion": "go1.5.1",
"Deps": [
{
- "ImportPath": "code.google.com/p/log4go",
- "Comment": "go.weekly.2012-02-22-1",
- "Rev": "c3294304d93f48a37d3bed1d382882a9c2989f99"
+ "ImportPath": "github.com/alecthomas/log4go",
+ "Rev": "8e9057c3b25c409a34c0b9737cdc82cbcafeabce"
},
{
"ImportPath": "github.com/braintree/manners",
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/.hgtags b/Godeps/_workspace/src/code.google.com/p/log4go/.hgtags
deleted file mode 100644
index 72a2eea2c..000000000
--- a/Godeps/_workspace/src/code.google.com/p/log4go/.hgtags
+++ /dev/null
@@ -1,4 +0,0 @@
-4fbe6aadba231e838a449d340e43bdaab0bf85bd go.weekly.2012-02-07
-56168fd53249d639c25c74ced881fffb20d27be9 go.weekly.2012-02-22
-56168fd53249d639c25c74ced881fffb20d27be9 go.weekly.2012-02-22
-5c22fbd77d91f54d76cdbdee05318699754c44cc go.weekly.2012-02-22
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/log4go_test.go b/Godeps/_workspace/src/code.google.com/p/log4go/log4go_test.go
deleted file mode 100644
index 90c629977..000000000
--- a/Godeps/_workspace/src/code.google.com/p/log4go/log4go_test.go
+++ /dev/null
@@ -1,534 +0,0 @@
-// Copyright (C) 2010, Kyle Lemons <kyle@kylelemons.net>. All rights reserved.
-
-package log4go
-
-import (
- "crypto/md5"
- "encoding/hex"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "runtime"
- "testing"
- "time"
-)
-
-const testLogFile = "_logtest.log"
-
-var now time.Time = time.Unix(0, 1234567890123456789).In(time.UTC)
-
-func newLogRecord(lvl level, src string, msg string) *LogRecord {
- return &LogRecord{
- Level: lvl,
- Source: src,
- Created: now,
- Message: msg,
- }
-}
-
-func TestELog(t *testing.T) {
- fmt.Printf("Testing %s\n", L4G_VERSION)
- lr := newLogRecord(CRITICAL, "source", "message")
- if lr.Level != CRITICAL {
- t.Errorf("Incorrect level: %d should be %d", lr.Level, CRITICAL)
- }
- if lr.Source != "source" {
- t.Errorf("Incorrect source: %s should be %s", lr.Source, "source")
- }
- if lr.Message != "message" {
- t.Errorf("Incorrect message: %s should be %s", lr.Source, "message")
- }
-}
-
-var formatTests = []struct {
- Test string
- Record *LogRecord
- Formats map[string]string
-}{
- {
- Test: "Standard formats",
- Record: &LogRecord{
- Level: ERROR,
- Source: "source",
- Message: "message",
- Created: now,
- },
- Formats: map[string]string{
- // TODO(kevlar): How can I do this so it'll work outside of PST?
- FORMAT_DEFAULT: "[2009/02/13 23:31:30 UTC] [EROR] (source) message\n",
- FORMAT_SHORT: "[23:31 02/13/09] [EROR] message\n",
- FORMAT_ABBREV: "[EROR] message\n",
- },
- },
-}
-
-func TestFormatLogRecord(t *testing.T) {
- for _, test := range formatTests {
- name := test.Test
- for fmt, want := range test.Formats {
- if got := FormatLogRecord(fmt, test.Record); got != want {
- t.Errorf("%s - %s:", name, fmt)
- t.Errorf(" got %q", got)
- t.Errorf(" want %q", want)
- }
- }
- }
-}
-
-var logRecordWriteTests = []struct {
- Test string
- Record *LogRecord
- Console string
-}{
- {
- Test: "Normal message",
- Record: &LogRecord{
- Level: CRITICAL,
- Source: "source",
- Message: "message",
- Created: now,
- },
- Console: "[02/13/09 23:31:30] [CRIT] message\n",
- },
-}
-
-func TestConsoleLogWriter(t *testing.T) {
- console := make(ConsoleLogWriter)
-
- r, w := io.Pipe()
- go console.run(w)
- defer console.Close()
-
- buf := make([]byte, 1024)
-
- for _, test := range logRecordWriteTests {
- name := test.Test
-
- console.LogWrite(test.Record)
- n, _ := r.Read(buf)
-
- if got, want := string(buf[:n]), test.Console; got != want {
- t.Errorf("%s: got %q", name, got)
- t.Errorf("%s: want %q", name, want)
- }
- }
-}
-
-func TestFileLogWriter(t *testing.T) {
- defer func(buflen int) {
- LogBufferLength = buflen
- }(LogBufferLength)
- LogBufferLength = 0
-
- w := NewFileLogWriter(testLogFile, false)
- if w == nil {
- t.Fatalf("Invalid return: w should not be nil")
- }
- defer os.Remove(testLogFile)
-
- w.LogWrite(newLogRecord(CRITICAL, "source", "message"))
- w.Close()
- runtime.Gosched()
-
- if contents, err := ioutil.ReadFile(testLogFile); err != nil {
- t.Errorf("read(%q): %s", testLogFile, err)
- } else if len(contents) != 50 {
- t.Errorf("malformed filelog: %q (%d bytes)", string(contents), len(contents))
- }
-}
-
-func TestXMLLogWriter(t *testing.T) {
- defer func(buflen int) {
- LogBufferLength = buflen
- }(LogBufferLength)
- LogBufferLength = 0
-
- w := NewXMLLogWriter(testLogFile, false)
- if w == nil {
- t.Fatalf("Invalid return: w should not be nil")
- }
- defer os.Remove(testLogFile)
-
- w.LogWrite(newLogRecord(CRITICAL, "source", "message"))
- w.Close()
- runtime.Gosched()
-
- if contents, err := ioutil.ReadFile(testLogFile); err != nil {
- t.Errorf("read(%q): %s", testLogFile, err)
- } else if len(contents) != 185 {
- t.Errorf("malformed xmllog: %q (%d bytes)", string(contents), len(contents))
- }
-}
-
-func TestLogger(t *testing.T) {
- sl := NewDefaultLogger(WARNING)
- if sl == nil {
- t.Fatalf("NewDefaultLogger should never return nil")
- }
- if lw, exist := sl["stdout"]; lw == nil || exist != true {
- t.Fatalf("NewDefaultLogger produced invalid logger (DNE or nil)")
- }
- if sl["stdout"].Level != WARNING {
- t.Fatalf("NewDefaultLogger produced invalid logger (incorrect level)")
- }
- if len(sl) != 1 {
- t.Fatalf("NewDefaultLogger produced invalid logger (incorrect map count)")
- }
-
- //func (l *Logger) AddFilter(name string, level int, writer LogWriter) {}
- l := make(Logger)
- l.AddFilter("stdout", DEBUG, NewConsoleLogWriter())
- if lw, exist := l["stdout"]; lw == nil || exist != true {
- t.Fatalf("AddFilter produced invalid logger (DNE or nil)")
- }
- if l["stdout"].Level != DEBUG {
- t.Fatalf("AddFilter produced invalid logger (incorrect level)")
- }
- if len(l) != 1 {
- t.Fatalf("AddFilter produced invalid logger (incorrect map count)")
- }
-
- //func (l *Logger) Warn(format string, args ...interface{}) error {}
- if err := l.Warn("%s %d %#v", "Warning:", 1, []int{}); err.Error() != "Warning: 1 []int{}" {
- t.Errorf("Warn returned invalid error: %s", err)
- }
-
- //func (l *Logger) Error(format string, args ...interface{}) error {}
- if err := l.Error("%s %d %#v", "Error:", 10, []string{}); err.Error() != "Error: 10 []string{}" {
- t.Errorf("Error returned invalid error: %s", err)
- }
-
- //func (l *Logger) Critical(format string, args ...interface{}) error {}
- if err := l.Critical("%s %d %#v", "Critical:", 100, []int64{}); err.Error() != "Critical: 100 []int64{}" {
- t.Errorf("Critical returned invalid error: %s", err)
- }
-
- // Already tested or basically untestable
- //func (l *Logger) Log(level int, source, message string) {}
- //func (l *Logger) Logf(level int, format string, args ...interface{}) {}
- //func (l *Logger) intLogf(level int, format string, args ...interface{}) string {}
- //func (l *Logger) Finest(format string, args ...interface{}) {}
- //func (l *Logger) Fine(format string, args ...interface{}) {}
- //func (l *Logger) Debug(format string, args ...interface{}) {}
- //func (l *Logger) Trace(format string, args ...interface{}) {}
- //func (l *Logger) Info(format string, args ...interface{}) {}
-}
-
-func TestLogOutput(t *testing.T) {
- const (
- expected = "fdf3e51e444da56b4cb400f30bc47424"
- )
-
- // Unbuffered output
- defer func(buflen int) {
- LogBufferLength = buflen
- }(LogBufferLength)
- LogBufferLength = 0
-
- l := make(Logger)
-
- // Delete and open the output log without a timestamp (for a constant md5sum)
- l.AddFilter("file", FINEST, NewFileLogWriter(testLogFile, false).SetFormat("[%L] %M"))
- defer os.Remove(testLogFile)
-
- // Send some log messages
- l.Log(CRITICAL, "testsrc1", fmt.Sprintf("This message is level %d", int(CRITICAL)))
- l.Logf(ERROR, "This message is level %v", ERROR)
- l.Logf(WARNING, "This message is level %s", WARNING)
- l.Logc(INFO, func() string { return "This message is level INFO" })
- l.Trace("This message is level %d", int(TRACE))
- l.Debug("This message is level %s", DEBUG)
- l.Fine(func() string { return fmt.Sprintf("This message is level %v", FINE) })
- l.Finest("This message is level %v", FINEST)
- l.Finest(FINEST, "is also this message's level")
-
- l.Close()
-
- contents, err := ioutil.ReadFile(testLogFile)
- if err != nil {
- t.Fatalf("Could not read output log: %s", err)
- }
-
- sum := md5.New()
- sum.Write(contents)
- if sumstr := hex.EncodeToString(sum.Sum(nil)); sumstr != expected {
- t.Errorf("--- Log Contents:\n%s---", string(contents))
- t.Fatalf("Checksum does not match: %s (expecting %s)", sumstr, expected)
- }
-}
-
-func TestCountMallocs(t *testing.T) {
- const N = 1
- var m runtime.MemStats
- getMallocs := func() uint64 {
- runtime.ReadMemStats(&m)
- return m.Mallocs
- }
-
- // Console logger
- sl := NewDefaultLogger(INFO)
- mallocs := 0 - getMallocs()
- for i := 0; i < N; i++ {
- sl.Log(WARNING, "here", "This is a WARNING message")
- }
- mallocs += getMallocs()
- fmt.Printf("mallocs per sl.Log((WARNING, \"here\", \"This is a log message\"): %d\n", mallocs/N)
-
- // Console logger formatted
- mallocs = 0 - getMallocs()
- for i := 0; i < N; i++ {
- sl.Logf(WARNING, "%s is a log message with level %d", "This", WARNING)
- }
- mallocs += getMallocs()
- fmt.Printf("mallocs per sl.Logf(WARNING, \"%%s is a log message with level %%d\", \"This\", WARNING): %d\n", mallocs/N)
-
- // Console logger (not logged)
- sl = NewDefaultLogger(INFO)
- mallocs = 0 - getMallocs()
- for i := 0; i < N; i++ {
- sl.Log(DEBUG, "here", "This is a DEBUG log message")
- }
- mallocs += getMallocs()
- fmt.Printf("mallocs per unlogged sl.Log((WARNING, \"here\", \"This is a log message\"): %d\n", mallocs/N)
-
- // Console logger formatted (not logged)
- mallocs = 0 - getMallocs()
- for i := 0; i < N; i++ {
- sl.Logf(DEBUG, "%s is a log message with level %d", "This", DEBUG)
- }
- mallocs += getMallocs()
- fmt.Printf("mallocs per unlogged sl.Logf(WARNING, \"%%s is a log message with level %%d\", \"This\", WARNING): %d\n", mallocs/N)
-}
-
-func TestXMLConfig(t *testing.T) {
- const (
- configfile = "example.xml"
- )
-
- fd, err := os.Create(configfile)
- if err != nil {
- t.Fatalf("Could not open %s for writing: %s", configfile, err)
- }
-
- fmt.Fprintln(fd, "<logging>")
- fmt.Fprintln(fd, " <filter enabled=\"true\">")
- fmt.Fprintln(fd, " <tag>stdout</tag>")
- fmt.Fprintln(fd, " <type>console</type>")
- fmt.Fprintln(fd, " <!-- level is (:?FINEST|FINE|DEBUG|TRACE|INFO|WARNING|ERROR) -->")
- fmt.Fprintln(fd, " <level>DEBUG</level>")
- fmt.Fprintln(fd, " </filter>")
- fmt.Fprintln(fd, " <filter enabled=\"true\">")
- fmt.Fprintln(fd, " <tag>file</tag>")
- fmt.Fprintln(fd, " <type>file</type>")
- fmt.Fprintln(fd, " <level>FINEST</level>")
- fmt.Fprintln(fd, " <property name=\"filename\">test.log</property>")
- fmt.Fprintln(fd, " <!--")
- fmt.Fprintln(fd, " %T - Time (15:04:05 MST)")
- fmt.Fprintln(fd, " %t - Time (15:04)")
- fmt.Fprintln(fd, " %D - Date (2006/01/02)")
- fmt.Fprintln(fd, " %d - Date (01/02/06)")
- fmt.Fprintln(fd, " %L - Level (FNST, FINE, DEBG, TRAC, WARN, EROR, CRIT)")
- fmt.Fprintln(fd, " %S - Source")
- fmt.Fprintln(fd, " %M - Message")
- fmt.Fprintln(fd, " It ignores unknown format strings (and removes them)")
- fmt.Fprintln(fd, " Recommended: \"[%D %T] [%L] (%S) %M\"")
- fmt.Fprintln(fd, " -->")
- fmt.Fprintln(fd, " <property name=\"format\">[%D %T] [%L] (%S) %M</property>")
- fmt.Fprintln(fd, " <property name=\"rotate\">false</property> <!-- true enables log rotation, otherwise append -->")
- fmt.Fprintln(fd, " <property name=\"maxsize\">0M</property> <!-- \\d+[KMG]? Suffixes are in terms of 2**10 -->")
- fmt.Fprintln(fd, " <property name=\"maxlines\">0K</property> <!-- \\d+[KMG]? Suffixes are in terms of thousands -->")
- fmt.Fprintln(fd, " <property name=\"daily\">true</property> <!-- Automatically rotates when a log message is written after midnight -->")
- fmt.Fprintln(fd, " </filter>")
- fmt.Fprintln(fd, " <filter enabled=\"true\">")
- fmt.Fprintln(fd, " <tag>xmllog</tag>")
- fmt.Fprintln(fd, " <type>xml</type>")
- fmt.Fprintln(fd, " <level>TRACE</level>")
- fmt.Fprintln(fd, " <property name=\"filename\">trace.xml</property>")
- fmt.Fprintln(fd, " <property name=\"rotate\">true</property> <!-- true enables log rotation, otherwise append -->")
- fmt.Fprintln(fd, " <property name=\"maxsize\">100M</property> <!-- \\d+[KMG]? Suffixes are in terms of 2**10 -->")
- fmt.Fprintln(fd, " <property name=\"maxrecords\">6K</property> <!-- \\d+[KMG]? Suffixes are in terms of thousands -->")
- fmt.Fprintln(fd, " <property name=\"daily\">false</property> <!-- Automatically rotates when a log message is written after midnight -->")
- fmt.Fprintln(fd, " </filter>")
- fmt.Fprintln(fd, " <filter enabled=\"false\"><!-- enabled=false means this logger won't actually be created -->")
- fmt.Fprintln(fd, " <tag>donotopen</tag>")
- fmt.Fprintln(fd, " <type>socket</type>")
- fmt.Fprintln(fd, " <level>FINEST</level>")
- fmt.Fprintln(fd, " <property name=\"endpoint\">192.168.1.255:12124</property> <!-- recommend UDP broadcast -->")
- fmt.Fprintln(fd, " <property name=\"protocol\">udp</property> <!-- tcp or udp -->")
- fmt.Fprintln(fd, " </filter>")
- fmt.Fprintln(fd, "</logging>")
- fd.Close()
-
- log := make(Logger)
- log.LoadConfiguration(configfile)
- defer os.Remove("trace.xml")
- defer os.Remove("test.log")
- defer log.Close()
-
- // Make sure we got all loggers
- if len(log) != 3 {
- t.Fatalf("XMLConfig: Expected 3 filters, found %d", len(log))
- }
-
- // Make sure they're the right keys
- if _, ok := log["stdout"]; !ok {
- t.Errorf("XMLConfig: Expected stdout logger")
- }
- if _, ok := log["file"]; !ok {
- t.Fatalf("XMLConfig: Expected file logger")
- }
- if _, ok := log["xmllog"]; !ok {
- t.Fatalf("XMLConfig: Expected xmllog logger")
- }
-
- // Make sure they're the right type
- if _, ok := log["stdout"].LogWriter.(ConsoleLogWriter); !ok {
- t.Fatalf("XMLConfig: Expected stdout to be ConsoleLogWriter, found %T", log["stdout"].LogWriter)
- }
- if _, ok := log["file"].LogWriter.(*FileLogWriter); !ok {
- t.Fatalf("XMLConfig: Expected file to be *FileLogWriter, found %T", log["file"].LogWriter)
- }
- if _, ok := log["xmllog"].LogWriter.(*FileLogWriter); !ok {
- t.Fatalf("XMLConfig: Expected xmllog to be *FileLogWriter, found %T", log["xmllog"].LogWriter)
- }
-
- // Make sure levels are set
- if lvl := log["stdout"].Level; lvl != DEBUG {
- t.Errorf("XMLConfig: Expected stdout to be set to level %d, found %d", DEBUG, lvl)
- }
- if lvl := log["file"].Level; lvl != FINEST {
- t.Errorf("XMLConfig: Expected file to be set to level %d, found %d", FINEST, lvl)
- }
- if lvl := log["xmllog"].Level; lvl != TRACE {
- t.Errorf("XMLConfig: Expected xmllog to be set to level %d, found %d", TRACE, lvl)
- }
-
- // Make sure the w is open and points to the right file
- if fname := log["file"].LogWriter.(*FileLogWriter).file.Name(); fname != "test.log" {
- t.Errorf("XMLConfig: Expected file to have opened %s, found %s", "test.log", fname)
- }
-
- // Make sure the XLW is open and points to the right file
- if fname := log["xmllog"].LogWriter.(*FileLogWriter).file.Name(); fname != "trace.xml" {
- t.Errorf("XMLConfig: Expected xmllog to have opened %s, found %s", "trace.xml", fname)
- }
-
- // Move XML log file
- os.Rename(configfile, "examples/"+configfile) // Keep this so that an example with the documentation is available
-}
-
-func BenchmarkFormatLogRecord(b *testing.B) {
- const updateEvery = 1
- rec := &LogRecord{
- Level: CRITICAL,
- Created: now,
- Source: "source",
- Message: "message",
- }
- for i := 0; i < b.N; i++ {
- rec.Created = rec.Created.Add(1 * time.Second / updateEvery)
- if i%2 == 0 {
- FormatLogRecord(FORMAT_DEFAULT, rec)
- } else {
- FormatLogRecord(FORMAT_SHORT, rec)
- }
- }
-}
-
-func BenchmarkConsoleLog(b *testing.B) {
- /* This doesn't seem to work on OS X
- sink, err := os.Open(os.DevNull)
- if err != nil {
- panic(err)
- }
- if err := syscall.Dup2(int(sink.Fd()), syscall.Stdout); err != nil {
- panic(err)
- }
- */
-
- stdout = ioutil.Discard
- sl := NewDefaultLogger(INFO)
- for i := 0; i < b.N; i++ {
- sl.Log(WARNING, "here", "This is a log message")
- }
-}
-
-func BenchmarkConsoleNotLogged(b *testing.B) {
- sl := NewDefaultLogger(INFO)
- for i := 0; i < b.N; i++ {
- sl.Log(DEBUG, "here", "This is a log message")
- }
-}
-
-func BenchmarkConsoleUtilLog(b *testing.B) {
- sl := NewDefaultLogger(INFO)
- for i := 0; i < b.N; i++ {
- sl.Info("%s is a log message", "This")
- }
-}
-
-func BenchmarkConsoleUtilNotLog(b *testing.B) {
- sl := NewDefaultLogger(INFO)
- for i := 0; i < b.N; i++ {
- sl.Debug("%s is a log message", "This")
- }
-}
-
-func BenchmarkFileLog(b *testing.B) {
- sl := make(Logger)
- b.StopTimer()
- sl.AddFilter("file", INFO, NewFileLogWriter("benchlog.log", false))
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- sl.Log(WARNING, "here", "This is a log message")
- }
- b.StopTimer()
- os.Remove("benchlog.log")
-}
-
-func BenchmarkFileNotLogged(b *testing.B) {
- sl := make(Logger)
- b.StopTimer()
- sl.AddFilter("file", INFO, NewFileLogWriter("benchlog.log", false))
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- sl.Log(DEBUG, "here", "This is a log message")
- }
- b.StopTimer()
- os.Remove("benchlog.log")
-}
-
-func BenchmarkFileUtilLog(b *testing.B) {
- sl := make(Logger)
- b.StopTimer()
- sl.AddFilter("file", INFO, NewFileLogWriter("benchlog.log", false))
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- sl.Info("%s is a log message", "This")
- }
- b.StopTimer()
- os.Remove("benchlog.log")
-}
-
-func BenchmarkFileUtilNotLog(b *testing.B) {
- sl := make(Logger)
- b.StopTimer()
- sl.AddFilter("file", INFO, NewFileLogWriter("benchlog.log", false))
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- sl.Debug("%s is a log message", "This")
- }
- b.StopTimer()
- os.Remove("benchlog.log")
-}
-
-// Benchmark results (darwin amd64 6g)
-//elog.BenchmarkConsoleLog 100000 22819 ns/op
-//elog.BenchmarkConsoleNotLogged 2000000 879 ns/op
-//elog.BenchmarkConsoleUtilLog 50000 34380 ns/op
-//elog.BenchmarkConsoleUtilNotLog 1000000 1339 ns/op
-//elog.BenchmarkFileLog 100000 26497 ns/op
-//elog.BenchmarkFileNotLogged 2000000 821 ns/op
-//elog.BenchmarkFileUtilLog 50000 33945 ns/op
-//elog.BenchmarkFileUtilNotLog 1000000 1258 ns/op
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)
-}
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/.gitignore b/Godeps/_workspace/src/github.com/alecthomas/log4go/.gitignore
new file mode 100644
index 000000000..f6207cd8a
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/.gitignore
@@ -0,0 +1,2 @@
+*.sw[op]
+.DS_Store
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/LICENSE b/Godeps/_workspace/src/github.com/alecthomas/log4go/LICENSE
index 7093402bf..7093402bf 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/LICENSE
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/LICENSE
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/README b/Godeps/_workspace/src/github.com/alecthomas/log4go/README
index 16d80ecb7..16d80ecb7 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/README
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/README
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/config.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/config.go
index f048b69f5..577c3eb2f 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/config.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/config.go
@@ -53,7 +53,7 @@ func (log Logger) LoadConfiguration(filename string) {
for _, xmlfilt := range xc.Filter {
var filt LogWriter
- var lvl level
+ var lvl Level
bad, good, enabled := false, true, false
// Check required children
@@ -131,7 +131,7 @@ func (log Logger) LoadConfiguration(filename string) {
}
}
-func xmlToConsoleLogWriter(filename string, props []xmlProperty, enabled bool) (ConsoleLogWriter, bool) {
+func xmlToConsoleLogWriter(filename string, props []xmlProperty, enabled bool) (*ConsoleLogWriter, bool) {
// Parse properties
for _, prop := range props {
switch prop.Name {
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/examples/ConsoleLogWriter_Manual.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go
index 394ca8380..698dd332d 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/examples/ConsoleLogWriter_Manual.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go
@@ -8,6 +8,7 @@ import l4g "code.google.com/p/log4go"
func main() {
log := l4g.NewLogger()
+ defer log.Close()
log.AddFilter("stdout", l4g.DEBUG, l4g.NewConsoleLogWriter())
log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
}
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/examples/FileLogWriter_Manual.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go
index efd596aa6..efd596aa6 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/examples/FileLogWriter_Manual.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/examples/SimpleNetLogServer.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
index 83c80ad12..83c80ad12 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/examples/SimpleNetLogServer.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/examples/SocketLogWriter_Manual.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go
index 400b698ca..400b698ca 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/examples/SocketLogWriter_Manual.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/examples/XMLConfigurationExample.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go
index 164c2add4..164c2add4 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/examples/XMLConfigurationExample.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/examples/example.xml b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/example.xml
index e791278ce..e791278ce 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/examples/example.xml
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/example.xml
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/filelog.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/filelog.go
index 9cbd815d9..ee0ab0c04 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/filelog.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/filelog.go
@@ -3,8 +3,8 @@
package log4go
import (
- "os"
"fmt"
+ "os"
"time"
)
@@ -36,7 +36,8 @@ type FileLogWriter struct {
daily_opendate int
// Keep old logfiles (.001, .002, etc)
- rotate bool
+ rotate bool
+ maxbackup int
}
// This is the FileLogWriter's output method
@@ -46,6 +47,7 @@ func (w *FileLogWriter) LogWrite(rec *LogRecord) {
func (w *FileLogWriter) Close() {
close(w.rec)
+ w.file.Sync()
}
// NewFileLogWriter creates a new LogWriter which writes to the given file and
@@ -59,11 +61,12 @@ func (w *FileLogWriter) Close() {
// [%D %T] [%L] (%S) %M
func NewFileLogWriter(fname string, rotate bool) *FileLogWriter {
w := &FileLogWriter{
- rec: make(chan *LogRecord, LogBufferLength),
- rot: make(chan bool),
- filename: fname,
- format: "[%D %T] [%L] (%S) %M",
- rotate: rotate,
+ rec: make(chan *LogRecord, LogBufferLength),
+ rot: make(chan bool),
+ filename: fname,
+ format: "[%D %T] [%L] (%S) %M",
+ rotate: rotate,
+ maxbackup: 999,
}
// open the file for the first time
@@ -138,15 +141,30 @@ func (w *FileLogWriter) intRotate() error {
// Find the next available number
num := 1
fname := ""
- for ; err == nil && num <= 999; num++ {
- fname = w.filename + fmt.Sprintf(".%03d", num)
- _, err = os.Lstat(fname)
- }
- // return error if the last file checked still existed
- if err == nil {
- return fmt.Errorf("Rotate: Cannot find free log number to rename %s\n", w.filename)
+ if w.daily && time.Now().Day() != w.daily_opendate {
+ yesterday := time.Now().AddDate(0, 0, -1).Format("2006-01-02")
+
+ for ; err == nil && num <= 999; num++ {
+ fname = w.filename + fmt.Sprintf(".%s.%03d", yesterday, num)
+ _, err = os.Lstat(fname)
+ }
+ // return error if the last file checked still existed
+ if err == nil {
+ return fmt.Errorf("Rotate: Cannot find free log number to rename %s\n", w.filename)
+ }
+ } else {
+ num = w.maxbackup - 1
+ for ; num >= 1; num-- {
+ fname = w.filename + fmt.Sprintf(".%d", num)
+ nfname := w.filename + fmt.Sprintf(".%d", num+1)
+ _, err = os.Lstat(fname)
+ if err == nil {
+ os.Rename(fname, nfname)
+ }
+ }
}
+ w.file.Close()
// Rename the file to its newfound home
err = os.Rename(w.filename, fname)
if err != nil {
@@ -217,6 +235,13 @@ func (w *FileLogWriter) SetRotateDaily(daily bool) *FileLogWriter {
return w
}
+// Set max backup files. Must be called before the first log message
+// is written.
+func (w *FileLogWriter) SetRotateMaxBackup(maxbackup int) *FileLogWriter {
+ w.maxbackup = maxbackup
+ return w
+}
+
// SetRotate changes whether or not the old logs are kept. (chainable) Must be
// called before the first log message is written. If rotate is false, the
// files are overwritten; otherwise, they are rotated to another file before the
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/log4go.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/log4go.go
index ab4e857f5..822e890cc 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/log4go.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/log4go.go
@@ -47,11 +47,11 @@ package log4go
import (
"errors"
- "os"
"fmt"
- "time"
- "strings"
+ "os"
"runtime"
+ "strings"
+ "time"
)
// Version information
@@ -65,10 +65,10 @@ const (
/****** Constants ******/
// These are the integer logging levels used by the logger
-type level int
+type Level int
const (
- FINEST level = iota
+ FINEST Level = iota
FINE
DEBUG
TRACE
@@ -83,7 +83,7 @@ var (
levelStrings = [...]string{"FNST", "FINE", "DEBG", "TRAC", "INFO", "WARN", "EROR", "CRIT"}
)
-func (l level) String() string {
+func (l Level) String() string {
if l < 0 || int(l) > len(levelStrings) {
return "UNKNOWN"
}
@@ -101,7 +101,7 @@ var (
// A LogRecord contains all of the pertinent information for each message
type LogRecord struct {
- Level level // The log level
+ Level Level // The log level
Created time.Time // The time at which the log message was created (nanoseconds)
Source string // The message source
Message string // The log message
@@ -124,7 +124,7 @@ type LogWriter interface {
// A Filter represents the log level below which no log records are written to
// the associated LogWriter.
type Filter struct {
- Level level
+ Level Level
LogWriter
}
@@ -144,7 +144,7 @@ func NewLogger() Logger {
// or above lvl to standard output.
//
// DEPRECATED: use NewDefaultLogger instead.
-func NewConsoleLogger(lvl level) Logger {
+func NewConsoleLogger(lvl Level) Logger {
os.Stderr.WriteString("warning: use of deprecated NewConsoleLogger\n")
return Logger{
"stdout": &Filter{lvl, NewConsoleLogWriter()},
@@ -153,7 +153,7 @@ func NewConsoleLogger(lvl level) Logger {
// Create a new logger with a "stdout" filter configured to send log messages at
// or above lvl to standard output.
-func NewDefaultLogger(lvl level) Logger {
+func NewDefaultLogger(lvl Level) Logger {
return Logger{
"stdout": &Filter{lvl, NewConsoleLogWriter()},
}
@@ -174,14 +174,14 @@ func (log Logger) Close() {
// Add a new LogWriter to the Logger which will only log messages at lvl or
// higher. This function should not be called from multiple goroutines.
// Returns the logger for chaining.
-func (log Logger) AddFilter(name string, lvl level, writer LogWriter) Logger {
+func (log Logger) AddFilter(name string, lvl Level, writer LogWriter) Logger {
log[name] = &Filter{lvl, writer}
return log
}
/******* Logging *******/
// Send a formatted log message internally
-func (log Logger) intLogf(lvl level, format string, args ...interface{}) {
+func (log Logger) intLogf(lvl Level, format string, args ...interface{}) {
skip := true
// Determine if any logging will be done
@@ -225,7 +225,7 @@ func (log Logger) intLogf(lvl level, format string, args ...interface{}) {
}
// Send a closure log message internally
-func (log Logger) intLogc(lvl level, closure func() string) {
+func (log Logger) intLogc(lvl Level, closure func() string) {
skip := true
// Determine if any logging will be done
@@ -264,7 +264,7 @@ func (log Logger) intLogc(lvl level, closure func() string) {
}
// Send a log message with manual level, source, and message.
-func (log Logger) Log(lvl level, source, message string) {
+func (log Logger) Log(lvl Level, source, message string) {
skip := true
// Determine if any logging will be done
@@ -297,13 +297,13 @@ func (log Logger) Log(lvl level, source, message string) {
// Logf logs a formatted log message at the given log level, using the caller as
// its source.
-func (log Logger) Logf(lvl level, format string, args ...interface{}) {
+func (log Logger) Logf(lvl Level, format string, args ...interface{}) {
log.intLogf(lvl, format, args...)
}
// Logc logs a string returned by the closure at the given log level, using the caller as
// its source. If no log message would be written, the closure is never called.
-func (log Logger) Logc(lvl level, closure func() string) {
+func (log Logger) Logc(lvl Level, closure func() string) {
log.intLogc(lvl, closure)
}
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/pattlog.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/pattlog.go
index 8224302b3..82b4e36b1 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/pattlog.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/pattlog.go
@@ -3,9 +3,10 @@
package log4go
import (
- "fmt"
"bytes"
+ "fmt"
"io"
+ "strings"
)
const (
@@ -51,7 +52,7 @@ func FormatLogRecord(format string, rec *LogRecord) string {
updated := &formatCacheType{
LastUpdateSeconds: secs,
shortTime: fmt.Sprintf("%02d:%02d", hour, minute),
- shortDate: fmt.Sprintf("%02d/%02d/%02d", month, day, year%100),
+ shortDate: fmt.Sprintf("%02d/%02d/%02d", day, month, year%100),
longTime: fmt.Sprintf("%02d:%02d:%02d %s", hour, minute, second, zone),
longDate: fmt.Sprintf("%04d/%02d/%02d", year, month, day),
}
@@ -78,6 +79,9 @@ func FormatLogRecord(format string, rec *LogRecord) string {
out.WriteString(levelStrings[rec.Level])
case 'S':
out.WriteString(rec.Source)
+ case 's':
+ slice := strings.Split(rec.Source, "/")
+ out.WriteString(slice[len(slice)-1])
case 'M':
out.WriteString(rec.Message)
}
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/socklog.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/socklog.go
index 1d224a99d..1d224a99d 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/socklog.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/socklog.go
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/termlog.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/termlog.go
new file mode 100644
index 000000000..8a941e269
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/termlog.go
@@ -0,0 +1,49 @@
+// Copyright (C) 2010, Kyle Lemons <kyle@kylelemons.net>. All rights reserved.
+
+package log4go
+
+import (
+ "fmt"
+ "io"
+ "os"
+ "time"
+)
+
+var stdout io.Writer = os.Stdout
+
+// This is the standard writer that prints to standard output.
+type ConsoleLogWriter struct {
+ format string
+ w chan *LogRecord
+}
+
+// This creates a new ConsoleLogWriter
+func NewConsoleLogWriter() *ConsoleLogWriter {
+ consoleWriter := &ConsoleLogWriter{
+ format: "[%T %D] [%L] (%S) %M",
+ w: make(chan *LogRecord, LogBufferLength),
+ }
+ go consoleWriter.run(stdout)
+ return consoleWriter
+}
+func (c *ConsoleLogWriter) SetFormat(format string) {
+ c.format = format
+}
+func (c *ConsoleLogWriter) run(out io.Writer) {
+ for rec := range c.w {
+ fmt.Fprint(out, FormatLogRecord(c.format, rec))
+ }
+}
+
+// This is the ConsoleLogWriter's output method. This will block if the output
+// buffer is full.
+func (c *ConsoleLogWriter) LogWrite(rec *LogRecord) {
+ c.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 (c *ConsoleLogWriter) Close() {
+ close(c.w)
+ time.Sleep(50 * time.Millisecond) // Try to give console I/O time to complete
+}
diff --git a/Godeps/_workspace/src/code.google.com/p/log4go/wrapper.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/wrapper.go
index 10ecd88e6..2ae222b0c 100644
--- a/Godeps/_workspace/src/code.google.com/p/log4go/wrapper.go
+++ b/Godeps/_workspace/src/github.com/alecthomas/log4go/wrapper.go
@@ -4,8 +4,8 @@ package log4go
import (
"errors"
- "os"
"fmt"
+ "os"
"strings"
)
@@ -23,7 +23,7 @@ func LoadConfiguration(filename string) {
}
// Wrapper for (*Logger).AddFilter
-func AddFilter(name string, lvl level, writer LogWriter) {
+func AddFilter(name string, lvl Level, writer LogWriter) {
Global.AddFilter(name, lvl, writer)
}
@@ -88,19 +88,19 @@ func Stdoutf(format string, args ...interface{}) {
// Send a log message manually
// Wrapper for (*Logger).Log
-func Log(lvl level, source, message string) {
+func Log(lvl Level, source, message string) {
Global.Log(lvl, source, message)
}
// Send a formatted log message easily
// Wrapper for (*Logger).Logf
-func Logf(lvl level, format string, args ...interface{}) {
+func Logf(lvl Level, format string, args ...interface{}) {
Global.intLogf(lvl, format, args...)
}
// Send a closure log message
// Wrapper for (*Logger).Logc
-func Logc(lvl level, closure func() string) {
+func Logc(lvl Level, closure func() string) {
Global.intLogc(lvl, closure)
}
diff --git a/api/admin.go b/api/admin.go
index 8e0a03e4b..885a95d95 100644
--- a/api/admin.go
+++ b/api/admin.go
@@ -9,7 +9,7 @@ import (
"os"
"strings"
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
diff --git a/api/api.go b/api/api.go
index 6c7eda0a2..a6bb22982 100644
--- a/api/api.go
+++ b/api/api.go
@@ -5,7 +5,7 @@ package api
import (
"bytes"
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"html/template"
diff --git a/api/channel.go b/api/channel.go
index 674293e19..706baa004 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -4,8 +4,8 @@
package api
import (
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"net/http"
diff --git a/api/command.go b/api/command.go
index db57f0bae..00293cf16 100644
--- a/api/command.go
+++ b/api/command.go
@@ -11,7 +11,7 @@ import (
"strings"
"time"
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
diff --git a/api/context.go b/api/context.go
index b39f03a7d..561884c14 100644
--- a/api/context.go
+++ b/api/context.go
@@ -11,7 +11,7 @@ import (
"strconv"
"strings"
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
"github.com/mattermost/platform/utils"
diff --git a/api/file.go b/api/file.go
index 67ebc14b7..d023515af 100644
--- a/api/file.go
+++ b/api/file.go
@@ -5,8 +5,8 @@ package api
import (
"bytes"
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/disintegration/imaging"
"github.com/goamz/goamz/aws"
"github.com/goamz/goamz/s3"
diff --git a/api/import.go b/api/import.go
index 81de78975..5c8f99348 100644
--- a/api/import.go
+++ b/api/import.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
)
diff --git a/api/oauth.go b/api/oauth.go
index 5753db8bd..eb5e0e496 100644
--- a/api/oauth.go
+++ b/api/oauth.go
@@ -4,8 +4,8 @@
package api
import (
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
diff --git a/api/post.go b/api/post.go
index 958479427..be1ecd96a 100644
--- a/api/post.go
+++ b/api/post.go
@@ -4,8 +4,8 @@
package api
import (
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
diff --git a/api/preference.go b/api/preference.go
index e9c74aafe..f5c96f1dd 100644
--- a/api/preference.go
+++ b/api/preference.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"net/http"
diff --git a/api/server.go b/api/server.go
index 2bab62fac..33428009f 100644
--- a/api/server.go
+++ b/api/server.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/braintree/manners"
"github.com/gorilla/mux"
"github.com/mattermost/platform/store"
diff --git a/api/slackimport.go b/api/slackimport.go
index cab4c6184..e0a0ff036 100644
--- a/api/slackimport.go
+++ b/api/slackimport.go
@@ -6,8 +6,8 @@ package api
import (
"archive/zip"
"bytes"
- l4g "code.google.com/p/log4go"
"encoding/json"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
"io"
"mime/multipart"
diff --git a/api/team.go b/api/team.go
index fbcb301a9..e2dd8807e 100644
--- a/api/team.go
+++ b/api/team.go
@@ -5,8 +5,8 @@ package api
import (
"bytes"
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
diff --git a/api/user.go b/api/user.go
index d4c7fcaf5..6c0ce86d6 100644
--- a/api/user.go
+++ b/api/user.go
@@ -5,9 +5,9 @@ package api
import (
"bytes"
- l4g "code.google.com/p/log4go"
b64 "encoding/base64"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/disintegration/imaging"
"github.com/golang/freetype"
"github.com/gorilla/mux"
diff --git a/api/web_conn.go b/api/web_conn.go
index 50a003ace..2b0e29038 100644
--- a/api/web_conn.go
+++ b/api/web_conn.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/websocket"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"
diff --git a/api/web_hub.go b/api/web_hub.go
index f80488824..4361d1035 100644
--- a/api/web_hub.go
+++ b/api/web_hub.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
)
diff --git a/api/web_socket.go b/api/web_socket.go
index 298e44b44..995e2a677 100644
--- a/api/web_socket.go
+++ b/api/web_socket.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"github.com/mattermost/platform/model"
diff --git a/api/web_team_hub.go b/api/web_team_hub.go
index 2c2386317..bb9ed9526 100644
--- a/api/web_team_hub.go
+++ b/api/web_team_hub.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
)
diff --git a/api/webhook.go b/api/webhook.go
index 34c308879..a9a88b7b8 100644
--- a/api/webhook.go
+++ b/api/webhook.go
@@ -4,7 +4,7 @@
package api
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
diff --git a/config/config.json b/config/config.json
index c43db1e50..076f795cc 100644
--- a/config/config.json
+++ b/config/config.json
@@ -12,10 +12,10 @@
"EnableTesting": false,
"EnableDeveloper": false,
"EnableSecurityFixAlert": true,
- "SessionLengthWebInDays" : 30,
- "SessionLengthMobileInDays" : 30,
- "SessionLengthSSOInDays" : 30,
- "SessionCacheInMinutes" : 10
+ "SessionLengthWebInDays": 30,
+ "SessionLengthMobileInDays": 30,
+ "SessionLengthSSOInDays": 30,
+ "SessionCacheInMinutes": 10
},
"TeamSettings": {
"SiteName": "Mattermost",
diff --git a/doc/developer/tests/test-markdown-basics.md b/doc/developer/tests/test-markdown-basics.md
index 7a46adeb0..cea9a0867 100644
--- a/doc/developer/tests/test-markdown-basics.md
+++ b/doc/developer/tests/test-markdown-basics.md
@@ -18,6 +18,18 @@ Normal Text_
_Normal Text
_Normal Text*
+### Carriage Return
+
+**The following text should render as:**
+Line #1 followed by Line #2
+Line #2 followed by one blank line
+
+Line #3 followed by one blank line
+
+
+Line #4 following one blank line
+
+
### Code Blocks
```
@@ -119,7 +131,7 @@ Text below line
**The following markdown should render within the block quote:**
> #### Heading 4
-> _Italics_, *Italics*, **Bold**, ***Bold-italics***, **Bold-italics_**, ~~Strikethrough~~
+> _Italics_, *Italics*, **Bold**, ***Bold-italics***, **_Bold-italics_**, ~~Strikethrough~~
> :) :-) ;) :-O :bamboo: :gift_heart: :dolls:
**The following text should render in two block quotes separated by one line of text:**
diff --git a/docker/1.4/Dockerfile b/docker/1.4/Dockerfile
new file mode 100644
index 000000000..0e8b8853f
--- /dev/null
+++ b/docker/1.4/Dockerfile
@@ -0,0 +1,49 @@
+# Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+# See License.txt for license information.
+FROM ubuntu:14.04
+
+#
+# Install SQL
+#
+
+ENV MYSQL_ROOT_PASSWORD=mostest
+ENV MYSQL_USER=mmuser
+ENV MYSQL_PASSWORD=mostest
+ENV MYSQL_DATABASE=mattermost_test
+
+RUN groupadd -r mysql && useradd -r -g mysql mysql
+
+RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
+
+ENV MYSQL_MAJOR 5.6
+ENV MYSQL_VERSION 5.6.25
+
+RUN echo "deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list
+
+RUN apt-get update \
+ && export DEBIAN_FRONTEND=noninteractive \
+ && apt-get -y install perl wget mysql-server \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql
+
+RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf
+
+VOLUME /var/lib/mysql
+# ---------------------------------------------------------------------------------------------------------------------
+
+WORKDIR /mattermost
+
+# Copy over files
+RUN wget --no-check-certificate https://s3.amazonaws.com/mattermost-travis-master/mattermost.tar.gz
+RUN tar -zxvf mattermost.tar.gz --strip-components=1 && rm mattermost.tar.gz
+ADD config_docker.json /
+ADD docker-entry.sh /
+
+RUN chmod +x /docker-entry.sh
+ENTRYPOINT /docker-entry.sh
+
+# Create default storage directory
+RUN mkdir /mattermost-data/
+
+# Ports
+EXPOSE 80
diff --git a/docker/1.4/Dockerrun.aws.zip b/docker/1.4/Dockerrun.aws.zip
new file mode 100644
index 000000000..272ea9c54
--- /dev/null
+++ b/docker/1.4/Dockerrun.aws.zip
Binary files differ
diff --git a/docker/1.4/Dockerrun.aws/.ebextensions/01_files.config b/docker/1.4/Dockerrun.aws/.ebextensions/01_files.config
new file mode 100644
index 000000000..7f40a8b34
--- /dev/null
+++ b/docker/1.4/Dockerrun.aws/.ebextensions/01_files.config
@@ -0,0 +1,14 @@
+files:
+ "/etc/nginx/conf.d/proxy.conf":
+ mode: "000755"
+ owner: root
+ group: root
+ content: |
+ client_max_body_size 50M;
+ "/opt/elasticbeanstalk/hooks/appdeploy/post/init.sh":
+ mode: "000755"
+ owner: root
+ group: root
+ content: |
+ #!/usr/bin/env bash
+ gpasswd -a ec2-user docker
diff --git a/docker/1.4/Dockerrun.aws/Dockerrun.aws.json b/docker/1.4/Dockerrun.aws/Dockerrun.aws.json
new file mode 100755
index 000000000..654961589
--- /dev/null
+++ b/docker/1.4/Dockerrun.aws/Dockerrun.aws.json
@@ -0,0 +1,13 @@
+{
+ "AWSEBDockerrunVersion": "1",
+ "Image": {
+ "Name": "mattermost/platform:1.4",
+ "Update": "true"
+ },
+ "Ports": [
+ {
+ "ContainerPort": "80"
+ }
+ ],
+ "Logging": "/var/log/"
+}
diff --git a/docker/1.4/README.md b/docker/1.4/README.md
new file mode 100644
index 000000000..f737a1554
--- /dev/null
+++ b/docker/1.4/README.md
@@ -0,0 +1,23 @@
+Mattermost
+==========
+
+http:/mattermost.org
+
+Mattermost is an open-source team communication service. It brings team messaging and file sharing into one place, accessible across PCs and phones, with archiving and search.
+
+Installing Mattermost
+=====================
+
+To run an instance of the latest version of mattermost on your local machine you can run:
+
+`docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform`
+
+To update this image to the latest version you can run:
+
+`docker pull mattermost/platform`
+
+To run an instance of the latest code from the master branch on GitHub you can run:
+
+`docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform:dev`
+
+Any questions, please visit http://forum.mattermost.org
diff --git a/docker/1.4/config_docker.json b/docker/1.4/config_docker.json
new file mode 100644
index 000000000..1aa2ee843
--- /dev/null
+++ b/docker/1.4/config_docker.json
@@ -0,0 +1,111 @@
+{
+ "ServiceSettings": {
+ "ListenAddress": ":80",
+ "MaximumLoginAttempts": 10,
+ "SegmentDeveloperKey": "",
+ "GoogleDeveloperKey": "",
+ "EnableOAuthServiceProvider": false,
+ "EnableIncomingWebhooks": false,
+ "EnableOutgoingWebhooks": false,
+ "EnablePostUsernameOverride": false,
+ "EnablePostIconOverride": false,
+ "EnableTesting": false,
+ "EnableDeveloper": false,
+ "EnableSecurityFixAlert": true,
+ "SessionLengthWebInDays" : 30,
+ "SessionLengthMobileInDays" : 30,
+ "SessionLengthSSOInDays" : 30,
+ "SessionCacheInMinutes" : 10
+ },
+ "TeamSettings": {
+ "SiteName": "Mattermost",
+ "MaxUsersPerTeam": 50,
+ "EnableTeamCreation": true,
+ "EnableUserCreation": true,
+ "RestrictCreationToDomains": "",
+ "RestrictTeamNames": true,
+ "EnableTeamListing": false
+ },
+ "SqlSettings": {
+ "DriverName": "mysql",
+ "DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8",
+ "DataSourceReplicas": [],
+ "MaxIdleConns": 10,
+ "MaxOpenConns": 10,
+ "Trace": false,
+ "AtRestEncryptKey": "7rAh6iwQCkV4cA1Gsg3fgGOXJAQ43QVg"
+ },
+ "LogSettings": {
+ "EnableConsole": false,
+ "ConsoleLevel": "INFO",
+ "EnableFile": true,
+ "FileLevel": "INFO",
+ "FileFormat": "",
+ "FileLocation": ""
+ },
+ "FileSettings": {
+ "DriverName": "local",
+ "Directory": "/mattermost/data/",
+ "EnablePublicLink": true,
+ "PublicLinkSalt": "A705AklYF8MFDOfcwh3I488G8vtLlVip",
+ "ThumbnailWidth": 120,
+ "ThumbnailHeight": 100,
+ "PreviewWidth": 1024,
+ "PreviewHeight": 0,
+ "ProfileWidth": 128,
+ "ProfileHeight": 128,
+ "InitialFont": "luximbi.ttf",
+ "AmazonS3AccessKeyId": "",
+ "AmazonS3SecretAccessKey": "",
+ "AmazonS3Bucket": "",
+ "AmazonS3Region": "",
+ "AmazonS3Endpoint": "",
+ "AmazonS3BucketEndpoint": "",
+ "AmazonS3LocationConstraint": false,
+ "AmazonS3LowercaseBucket": false
+ },
+ "EmailSettings": {
+ "EnableSignUpWithEmail": true,
+ "SendEmailNotifications": false,
+ "RequireEmailVerification": false,
+ "FeedbackName": "",
+ "FeedbackEmail": "",
+ "SMTPUsername": "",
+ "SMTPPassword": "",
+ "SMTPServer": "",
+ "SMTPPort": "",
+ "ConnectionSecurity": "",
+ "InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS",
+ "PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL",
+ "SendPushNotifications": false,
+ "PushNotificationServer": ""
+ },
+ "RateLimitSettings": {
+ "EnableRateLimiter": true,
+ "PerSec": 10,
+ "MemoryStoreSize": 10000,
+ "VaryByRemoteAddr": true,
+ "VaryByHeader": ""
+ },
+ "PrivacySettings": {
+ "ShowEmailAddress": true,
+ "ShowFullName": true
+ },
+ "SupportSettings": {
+ "TermsOfServiceLink": "/static/help/terms.html",
+ "PrivacyPolicyLink": "/static/help/privacy.html",
+ "AboutLink": "/static/help/about.html",
+ "HelpLink": "/static/help/help.html",
+ "ReportAProblemLink": "/static/help/report_problem.html",
+ "SupportEmail": "feedback@mattermost.com"
+ },
+ "GitLabSettings": {
+ "Enable": false,
+ "Secret": "",
+ "Id": "",
+ "Scope": "",
+ "AuthEndpoint": "",
+ "TokenEndpoint": "",
+ "UserApiEndpoint": ""
+ }
+}
diff --git a/docker/1.4/docker-entry.sh b/docker/1.4/docker-entry.sh
new file mode 100755
index 000000000..6bd2a1263
--- /dev/null
+++ b/docker/1.4/docker-entry.sh
@@ -0,0 +1,111 @@
+#!/bin/bash
+# Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+# See License.txt for license information.
+
+mkdir -p web/static/js
+
+echo "127.0.0.1 dockerhost" >> /etc/hosts
+/etc/init.d/networking restart
+
+echo configuring mysql
+
+# SQL!!!
+set -e
+
+get_option () {
+ local section=$1
+ local option=$2
+ local default=$3
+ ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-)
+ [ -z $ret ] && ret=$default
+ echo $ret
+}
+
+
+# Get config
+DATADIR="$("mysqld" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')"
+SOCKET=$(get_option mysqld socket "$DATADIR/mysql.sock")
+PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid")
+
+if [ ! -d "$DATADIR/mysql" ]; then
+ if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then
+ echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set'
+ echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?'
+ exit 1
+ fi
+
+ mkdir -p "$DATADIR"
+ chown -R mysql:mysql "$DATADIR"
+
+ echo 'Running mysql_install_db'
+ mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf
+ echo 'Finished mysql_install_db'
+
+ mysqld --user=mysql --datadir="$DATADIR" --skip-networking &
+ for i in $(seq 30 -1 0); do
+ [ -S "$SOCKET" ] && break
+ echo 'MySQL init process in progress...'
+ sleep 1
+ done
+ if [ $i = 0 ]; then
+ echo >&2 'MySQL init process failed.'
+ exit 1
+ fi
+
+ # These statements _must_ be on individual lines, and _must_ end with
+ # semicolons (no line breaks or comments are permitted).
+ # TODO proper SQL escaping on ALL the things D:
+
+ tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql)
+ cat > "$tempSqlFile" <<-EOSQL
+ -- What's done in this file shouldn't be replicated
+ -- or products like mysql-fabric won't work
+ SET @@SESSION.SQL_LOG_BIN=0;
+
+ DELETE FROM mysql.user ;
+ CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ;
+ GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ;
+ DROP DATABASE IF EXISTS test ;
+ EOSQL
+
+ if [ "$MYSQL_DATABASE" ]; then
+ echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile"
+ fi
+
+ if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then
+ echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile"
+
+ if [ "$MYSQL_DATABASE" ]; then
+ echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile"
+ fi
+ fi
+
+ echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile"
+
+ mysql -uroot < "$tempSqlFile"
+
+ rm -f "$tempSqlFile"
+ kill $(cat $PIDFILE)
+ for i in $(seq 30 -1 0); do
+ [ -f "$PIDFILE" ] || break
+ echo 'MySQL init process in progress...'
+ sleep 1
+ done
+ if [ $i = 0 ]; then
+ echo >&2 'MySQL hangs during init process.'
+ exit 1
+ fi
+ echo 'MySQL init process done. Ready for start up.'
+fi
+
+chown -R mysql:mysql "$DATADIR"
+
+mysqld &
+
+sleep 5
+
+# ------------------------
+
+echo starting platform
+cd /mattermost/bin
+./platform -config=/config_docker.json
diff --git a/manualtesting/manual_testing.go b/manualtesting/manual_testing.go
index b3d01a5a6..befc835fb 100644
--- a/manualtesting/manual_testing.go
+++ b/manualtesting/manual_testing.go
@@ -4,7 +4,7 @@
package manualtesting
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/api"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
diff --git a/manualtesting/test_autolink.go b/manualtesting/test_autolink.go
index a13ec7a75..16d2d713a 100644
--- a/manualtesting/test_autolink.go
+++ b/manualtesting/test_autolink.go
@@ -4,7 +4,7 @@
package manualtesting
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
)
diff --git a/mattermost.go b/mattermost.go
index 3d8ab736f..f86af76e3 100644
--- a/mattermost.go
+++ b/mattermost.go
@@ -17,7 +17,7 @@ import (
"syscall"
"time"
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/api"
"github.com/mattermost/platform/manualtesting"
"github.com/mattermost/platform/model"
diff --git a/model/client.go b/model/client.go
index 14746f8ae..75b93c971 100644
--- a/model/client.go
+++ b/model/client.go
@@ -5,8 +5,8 @@ package model
import (
"bytes"
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"io/ioutil"
"net/http"
"net/url"
diff --git a/model/version.go b/model/version.go
index 142ddb371..88334ceea 100644
--- a/model/version.go
+++ b/model/version.go
@@ -12,6 +12,7 @@ import (
// It should be maitained in chronological order with most current
// release at the front of the list.
var versions = []string{
+ "1.4.0",
"1.3.0",
"1.2.1",
"1.2.0",
diff --git a/store/sql_preference_store.go b/store/sql_preference_store.go
index 307761150..6302d2f4f 100644
--- a/store/sql_preference_store.go
+++ b/store/sql_preference_store.go
@@ -4,7 +4,7 @@
package store
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/go-gorp/gorp"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
diff --git a/store/sql_session_store.go b/store/sql_session_store.go
index 86604b4fe..6b0a31443 100644
--- a/store/sql_session_store.go
+++ b/store/sql_session_store.go
@@ -4,7 +4,7 @@
package store
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
)
diff --git a/store/sql_store.go b/store/sql_store.go
index d17a3e8c3..d0471fa1e 100644
--- a/store/sql_store.go
+++ b/store/sql_store.go
@@ -4,7 +4,6 @@
package store
import (
- l4g "code.google.com/p/log4go"
"crypto/aes"
"crypto/cipher"
"crypto/hmac"
@@ -16,6 +15,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"io"
sqltrace "log"
"math/rand"
diff --git a/store/store.go b/store/store.go
index 8e03c8ee7..179cfecd7 100644
--- a/store/store.go
+++ b/store/store.go
@@ -4,7 +4,7 @@
package store
import (
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
"time"
)
diff --git a/utils/config.go b/utils/config.go
index 18bd15241..12d03b5de 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -11,7 +11,7 @@ import (
"path/filepath"
"strconv"
- l4g "code.google.com/p/log4go"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
)
@@ -77,7 +77,9 @@ func configureLog(s *model.LogSettings) {
level = l4g.ERROR
}
- l4g.AddFilter("stdout", level, l4g.NewConsoleLogWriter())
+ lw := l4g.NewConsoleLogWriter()
+ lw.SetFormat("[%D %T] [%L] %M")
+ l4g.AddFilter("stdout", level, lw)
}
if s.EnableFile {
diff --git a/utils/mail.go b/utils/mail.go
index 6625060de..2f2c10b61 100644
--- a/utils/mail.go
+++ b/utils/mail.go
@@ -4,10 +4,10 @@
package utils
import (
- l4g "code.google.com/p/log4go"
"crypto/tls"
"encoding/base64"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
"net"
"net/mail"
diff --git a/web/react/components/admin_console/email_settings.jsx b/web/react/components/admin_console/email_settings.jsx
index 91d73dccd..193fd4147 100644
--- a/web/react/components/admin_console/email_settings.jsx
+++ b/web/react/components/admin_console/email_settings.jsx
@@ -581,12 +581,12 @@ export default class EmailSettings extends React.Component {
className='form-control'
id='PushNotificationServer'
ref='PushNotificationServer'
- placeholder='E.g.: "https://push.mattermost.com"'
+ placeholder='E.g.: "https://push-test.mattermost.com"'
defaultValue={this.props.config.EmailSettings.PushNotificationServer}
onChange={this.handleChange}
disabled={!this.state.sendPushNotifications}
/>
- <p className='help-text'>{'Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use https://push.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.'}</p>
+ <p className='help-text'>{'Location of Mattermost push notification service you can set up behind your firewall using https://github.com/mattermost/push-proxy. For testing you can use https://push-test.mattermost.com, which connects to the sample Mattermost iOS app in the public Apple AppStore. Please do not use test service for production deployments.'}</p>
</div>
</div>
diff --git a/web/web.go b/web/web.go
index bf1208adc..5cc0e288d 100644
--- a/web/web.go
+++ b/web/web.go
@@ -4,8 +4,8 @@
package web
import (
- l4g "code.google.com/p/log4go"
"fmt"
+ l4g "github.com/alecthomas/log4go"
"github.com/gorilla/mux"
"github.com/mattermost/platform/api"
"github.com/mattermost/platform/model"