From 29413c0e527a8c7eaf0362bc85fed0f49700c40c Mon Sep 17 00:00:00 2001 From: lealife Date: Fri, 1 Dec 2017 10:52:48 +0800 Subject: [PATCH] debug --- app/lea/Debug.go | 4 ++++ app/lea/i18n/i18n.go | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/lea/Debug.go b/app/lea/Debug.go index a0892cd..d432e2a 100644 --- a/app/lea/Debug.go +++ b/app/lea/Debug.go @@ -10,6 +10,10 @@ func Log(msg string, i ...interface{}) { revel.AppLog.Info(msg, i...) } +func Logf(msg string, i ...interface{}) { + revel.AppLog.Infof(msg, i...) +} + func LogW(msg string, i ...interface{}) { revel.AppLog.Warn(msg, i...) } diff --git a/app/lea/i18n/i18n.go b/app/lea/i18n/i18n.go index 34accf1..3152ac4 100644 --- a/app/lea/i18n/i18n.go +++ b/app/lea/i18n/i18n.go @@ -8,6 +8,7 @@ import ( "path/filepath" "regexp" "strings" + . "github.com/leanote/leanote/app/lea" ) const ( @@ -146,15 +147,15 @@ func loadMessageFile(locale string, path string, info os.FileInfo, osError error // If we have already parsed a message file for this locale, merge both if _, exists := messages[locale]; exists { messages[locale].Merge(config) - revel.TRACE.Printf("Successfully merged messages for locale '%s'", locale) + Logf("Successfully merged messages for locale '%s'", locale) } else { messages[locale] = config } - revel.TRACE.Println("Successfully loaded messages from file", info.Name()) + Logf("Successfully loaded messages from file", info.Name()) } } else { - revel.TRACE.Printf("Ignoring file %s because it did not have a valid extension", info.Name()) + Logf("Ignoring file %s because it did not have a valid extension", info.Name()) } return nil