mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
use log.Info() instead of fmt.Printf()
This commit is contained in:
parent
377279bfe5
commit
4e3f687634
1 changed files with 5 additions and 4 deletions
|
@ -22,11 +22,12 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"log"
|
||||
|
||||
"github.com/zpatrick/go-config"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
@ -61,9 +62,9 @@ func AddAdminUser(cfg *config.Config) (string, error) {
|
|||
}
|
||||
|
||||
if len(users) == 0 {
|
||||
fmt.Println("No admin user found in DB, adding default admin user.")
|
||||
log.Println("No admin user found in DB, adding default admin user.")
|
||||
if generatedPW {
|
||||
fmt.Printf(" Generated admin password: %s for admin user %s\n", adminPW, adminName)
|
||||
log.Printf(" Generated admin password: %s for admin user %s\n", adminPW, adminName)
|
||||
}
|
||||
|
||||
user := User{
|
||||
|
@ -80,7 +81,7 @@ func AddAdminUser(cfg *config.Config) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
} else if updatedPW {
|
||||
fmt.Println("Found existing admin user in DB, updating user from CLI parameters.")
|
||||
log.Println("Found existing admin user in DB, updating user from CLI parameters.")
|
||||
|
||||
user := users[0]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue