lni / dragonboat

A feature complete and high performance multi-group Raft library in Go.
Apache License 2.0
4.98k stars 533 forks source link

i cant find the location on how to switch to use tan log #311

Closed kolinfluence closed 1 year ago

kolinfluence commented 1 year ago

@lni would like to remove anything to do with pebbledb, how do i first use tan log?

found info here without mentioning how to use tan log.

also, how to disable pebbledb for the log if i use tan log too.

that's all. trying out now. trying to get it compile. go mod vendor is not helping with error message here: https://github.com/lni/dragonboat-example/issues/28

kevburnsjr commented 1 year ago

I've never used tan but it seems pretty straight forward after reading the code.
Probably something like this:

import (
    "github.com/lni/dragonboat/v4"
    "github.com/lni/dragonboat/v4/config"
    "github.com/lni/dragonboat/v4/plugin/tan"
)

func main() {
    exp := config.GetDefaultExpertConfig()
    exp.LogDBFactory = tan.Factory
    nh, err := dragonboat.NewNodeHost(config.NodeHostConfig{
        Expert: exp,
    })
}