api: rename createLogger to loggerCreate
This commit is contained in:
parent
b7b224983c
commit
1f45c04aca
@ -1,7 +1,7 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
exitIfError(createLogger())
|
||||
exitIfError(loggerCreate())
|
||||
exitIfError(configParse())
|
||||
exitIfError(connectDB(5))
|
||||
exitIfError(performMigrations())
|
||||
|
@ -106,7 +106,7 @@ func setupTestEnv() error {
|
||||
if !setupComplete {
|
||||
setupComplete = true
|
||||
|
||||
if err := createLogger(); err != nil {
|
||||
if err := loggerCreate(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user