api: rename createLogger to loggerCreate
This commit is contained in:
parent
b7b224983c
commit
1f45c04aca
@ -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())
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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")
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user