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
func main() {
exitIfError(createLogger())
exitIfError(loggerCreate())
exitIfError(configParse())
exitIfError(connectDB(5))
exitIfError(performMigrations())

View File

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

View File

@ -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")

View File

@ -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
}