mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-24 09:10:17 +01:00
Mute logging a bit.
This commit is contained in:
parent
b5d372765d
commit
787ea5d0ee
14
leveldb.go
14
leveldb.go
@ -72,11 +72,11 @@ func (ldbs *LevelDBSession) Fetch(hash, key []byte) (value []byte, err error) {
|
|||||||
ldbs.backend.doRead(func(db *leveldb.DB) {
|
ldbs.backend.doRead(func(db *leveldb.DB) {
|
||||||
ro := leveldb.NewReadOptions()
|
ro := leveldb.NewReadOptions()
|
||||||
value, err = ldbs.backend.db.Get(ro, key)
|
value, err = ldbs.backend.db.Get(ro, key)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
log.Printf("Fetch key = '%s' len(value) = %d\n", key, len(value))
|
// log.Printf("Fetch key '%s' failed.\n", key)
|
||||||
} else {
|
//} else {
|
||||||
log.Printf("Fetch key '%s' failed.\n", key)
|
// log.Printf("Fetch key = '%s' len(value) = %d\n", key, len(value))
|
||||||
}
|
//}
|
||||||
ro.Close()
|
ro.Close()
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -105,12 +105,12 @@ func (ldbs *LevelDBSession) Store(hash, key, value []byte) (exists bool, err err
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ldbs.tx != nil {
|
if ldbs.tx != nil {
|
||||||
log.Printf("Stored in tx: key = '%s' len(value) = %d\n", key, len(value))
|
//log.Printf("Stored in tx: key = '%s' len(value) = %d\n", key, len(value))
|
||||||
ldbs.tx.Put(key, value)
|
ldbs.tx.Put(key, value)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Stored: key = '%s' len(value) = %d\n", key, len(value))
|
//log.Printf("Stored: key = '%s' len(value) = %d\n", key, len(value))
|
||||||
wo := leveldb.NewWriteOptions()
|
wo := leveldb.NewWriteOptions()
|
||||||
err = ldbs.backend.db.Put(wo, key, value)
|
err = ldbs.backend.db.Put(wo, key, value)
|
||||||
wo.Close()
|
wo.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user