Refactoring, Bugfix & Updates

+ Refactored all imports
+ Fixed a bug for the logging regarding removing \n \t \r
+ Updated to current MGO release
+ Changed the name of ICCC
This commit is contained in:
Thorsten Sommer committed 2014-10-19 19:19:11 +02:00
1 parent b50066ef5d
commit f33f7b5c29
91 files changed
+496 -316

No files matched your search

+3 -1
View File
@@ -1,6 +1,8 @@
package Meta
import "time"
import (
"time"
)
type Entry struct {
Project string
+12 -10
View File
@@ -1,9 +1,11 @@
package Meta
import "fmt"
import "time"
import "strconv"
import "strings"
import (
"fmt"
"strconv"
"strings"
"time"
)
func (entry Entry) Format() (result string) {
@@ -23,18 +25,18 @@ func (entry Entry) Format() (result string) {
}
messageDescription := entry.MessageDescription
messageDescription = strings.Replace(messageDescription, `\n`, ` `, -1)
messageDescription = strings.Replace(messageDescription, `\t`, ` `, -1)
messageDescription = strings.Replace(messageDescription, `\r`, ` `, -1)
messageDescription = strings.Replace(messageDescription, "\n", ` `, -1)
messageDescription = strings.Replace(messageDescription, "\t", ` `, -1)
messageDescription = strings.Replace(messageDescription, "\r", ` `, -1)
result = fmt.Sprintf(` [■] P:%10s [■] %s [■] %10s [■] %11s [■] %10s [■] %10s [■] sender: %-40s [■] name: %-26s [■] %s [■]`, entry.Project[:lenProject], formatTime(entry.Time), FormatCategory(entry.Category), FormatLevel(entry.Level), FormatSeverity(entry.Severity), FormatImpact(entry.Impact), entry.Sender[:lenSender], entry.MessageName[:lenMessageName], messageDescription)
for _, param := range entry.Parameters {
paramText := param
paramText = strings.Replace(paramText, `\n`, ` `, -1)
paramText = strings.Replace(paramText, `\t`, ` `, -1)
paramText = strings.Replace(paramText, `\r`, ` `, -1)
paramText = strings.Replace(paramText, "\n", ` `, -1)
paramText = strings.Replace(paramText, "\t", ` `, -1)
paramText = strings.Replace(paramText, "\r", ` `, -1)
result = fmt.Sprintf(`%s %s [■]`, result, paramText)
}