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 }