diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index 30d108656..98c63b45f 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -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.