api: rename createLogger to loggerCreate

This commit is contained in:
Adhityaa Chandrasekar 2018-07-24 12:12:03 +05:30
parent b7b224983c
commit 1f45c04aca
4 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
package main package main
func main() { func main() {
exitIfError(createLogger()) exitIfError(loggerCreate())
exitIfError(configParse()) exitIfError(configParse())
exitIfError(connectDB(5)) exitIfError(connectDB(5))
exitIfError(performMigrations()) exitIfError(performMigrations())

View File

@ -106,7 +106,7 @@ func setupTestEnv() error {
if !setupComplete { if !setupComplete {
setupComplete = true setupComplete = true
if err := createLogger(); err != nil { if err := loggerCreate(); err != nil {
return err return err
} }

View File

@ -6,7 +6,7 @@ import (
var logger *logging.Logger var logger *logging.Logger
func createLogger() error { func loggerCreate() error {
format := logging.MustStringFormatter("[%{level}] %{shortfile} %{shortfunc}(): %{message}") format := logging.MustStringFormatter("[%{level}] %{shortfile} %{shortfunc}(): %{message}")
logging.SetFormatter(format) logging.SetFormatter(format)
logger = logging.MustGetLogger("commento") logger = logging.MustGetLogger("commento")

View File

@ -4,16 +4,16 @@ import (
"testing" "testing"
) )
func TestCreateLoggerBasics(t *testing.T) { func TestLoggerCreateBasics(t *testing.T) {
logger = nil logger = nil
if err := createLogger(); err != nil { if err := loggerCreate(); err != nil {
t.Errorf("unexpected error creating logger: %v", err) t.Errorf("unexpected error creating logger: %v", err)
return return
} }
if logger == nil { if logger == nil {
t.Errorf("logger null after createLogger()") t.Errorf("logger null after loggerCreate()")
return return
} }