1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add logger

This commit is contained in:
Frédéric Guillot 2017-12-15 18:55:57 -08:00
parent c6d9eb3614
commit 1d8193b892
56 changed files with 228 additions and 192 deletions

View file

@ -6,10 +6,10 @@ package storage
import (
"database/sql"
"log"
// Postgresql driver import
_ "github.com/lib/pq"
"github.com/miniflux/miniflux/logger"
)
// Storage handles all operations related to the database.
@ -26,7 +26,7 @@ func (s *Storage) Close() {
func NewStorage(databaseURL string, maxOpenConns int) *Storage {
db, err := sql.Open("postgres", databaseURL)
if err != nil {
log.Fatalf("Unable to connect to the database: %v", err)
logger.Fatal("[Storage] Unable to connect to the database: %v", err)
}
db.SetMaxOpenConns(maxOpenConns)