added storage logging

This commit is contained in:
Radu Ioan Fericean
2012-01-27 21:07:06 +02:00
parent 547f6c46f9
commit af262385aa
3 changed files with 9 additions and 2 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
a.out
*.a
*.6
*.pyc

View File

@@ -1,7 +1,8 @@
package main
import (
"github.com/fsouza/gokabinet/kc"
"log"
"github.com/fsouza/gokabinet/kc"
)
type KyotoStorage struct {
@@ -10,11 +11,13 @@ type KyotoStorage struct {
func NewKyotoStorage(filaName string) (*KyotoStorage, error) {
ndb, err := kc.Open(filaName, kc.READ)
log.Print("Starting kyoto storage")
return &KyotoStorage{db: ndb}, err
}
func (ks *KyotoStorage) Close() {
log.Print("Closing kyoto storage")
ks.db.Close()
}

View File

@@ -1,7 +1,8 @@
package main
import (
"github.com/simonz05/godis"
"log"
"github.com/simonz05/godis"
)
type RedisStorage struct {
@@ -10,11 +11,13 @@ type RedisStorage struct {
func NewRedisStorage(address string) (*RedisStorage, error) {
ndb:= godis.New(address, 10, "")
log.Print("Starting redis storage")
return &RedisStorage{db: ndb}, nil
}
func (rs *RedisStorage) Close() {
log.Print("Closing redis storage")
rs.db.Quit()
}