From 1f45c04aca197fa6d95f558fb7b5b167a3071fad Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Tue, 24 Jul 2018 12:12:03 +0530 Subject: [PATCH] api: rename createLogger to loggerCreate --- api/main.go | 2 +- api/testing.go | 2 +- api/utils_logging.go | 2 +- api/utils_logging_test.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/main.go b/api/main.go index 86185a1..d4177b1 100644 --- a/api/main.go +++ b/api/main.go @@ -1,7 +1,7 @@ package main func main() { - exitIfError(createLogger()) + exitIfError(loggerCreate()) exitIfError(configParse()) exitIfError(connectDB(5)) exitIfError(performMigrations()) diff --git a/api/testing.go b/api/testing.go index 7f7c13d..13af060 100644 --- a/api/testing.go +++ b/api/testing.go @@ -106,7 +106,7 @@ func setupTestEnv() error { if !setupComplete { setupComplete = true - if err := createLogger(); err != nil { + if err := loggerCreate(); err != nil { return err } diff --git a/api/utils_logging.go b/api/utils_logging.go index 811337d..9d8216d 100644 --- a/api/utils_logging.go +++ b/api/utils_logging.go @@ -6,7 +6,7 @@ import ( var logger *logging.Logger -func createLogger() error { +func loggerCreate() error { format := logging.MustStringFormatter("[%{level}] %{shortfile} %{shortfunc}(): %{message}") logging.SetFormatter(format) logger = logging.MustGetLogger("commento") diff --git a/api/utils_logging_test.go b/api/utils_logging_test.go index dda40c4..8bba2d7 100644 --- a/api/utils_logging_test.go +++ b/api/utils_logging_test.go @@ -4,16 +4,16 @@ import ( "testing" ) -func TestCreateLoggerBasics(t *testing.T) { +func TestLoggerCreateBasics(t *testing.T) { logger = nil - if err := createLogger(); err != nil { + if err := loggerCreate(); err != nil { t.Errorf("unexpected error creating logger: %v", err) return } if logger == nil { - t.Errorf("logger null after createLogger()") + t.Errorf("logger null after loggerCreate()") return }