add environment variables to turn on the debug log without recompiling

This commit is contained in:
vyzo 2021-07-08 21:30:39 +03:00
parent 60dd97c7fc
commit b6611125b6

View File

@ -5,6 +5,7 @@ import (
"context"
"encoding/binary"
"errors"
"os"
"sort"
"sync"
"sync/atomic"
@ -149,6 +150,16 @@ type SplitStore struct {
var _ bstore.Blockstore = (*SplitStore)(nil)
func init() {
if os.Getenv("LOTUS_SPLITSTORE_DEBUG_LOG") == "1" {
enableDebugLog = true
}
if os.Getenv("LOTUS_SPLITSTORE_DEBUG_LOG_WRITE_TRACES") == "1" {
enableDebugLogWriteTraces = true
}
}
// Open opens an existing splistore, or creates a new splitstore. The splitstore
// is backed by the provided hot and cold stores. The returned SplitStore MUST be
// attached to the ChainStore with Start in order to trigger compaction.