本文整理匯總了Golang中github.com/henryanand/vitess/go/vt/logutil.Logger.Printf方法的典型用法代碼示例。如果您正苦於以下問題:Golang Logger.Printf方法的具體用法?Golang Logger.Printf怎麽用?Golang Logger.Printf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/henryanand/vitess/go/vt/logutil.Logger
的用法示例。
在下文中一共展示了Logger.Printf方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewSplitStrategy
func NewSplitStrategy(logger logutil.Logger, argsStr string) (*SplitStrategy, error) {
var args []string
if argsStr != "" {
args = strings.Split(argsStr, " ")
}
flagSet := flag.NewFlagSet("strategy", flag.ContinueOnError)
flagSet.SetOutput(logutil.NewLoggerWriter(logger))
flagSet.Usage = func() {
logger.Printf("Strategy flag has the following options:\n")
flagSet.PrintDefaults()
}
populateBlpCheckpoint := flagSet.Bool("populate_blp_checkpoint", false, "populates the blp checkpoint table")
dontStartBinlogPlayer := flagSet.Bool("dont_start_binlog_player", false, "do not start the binlog player after restore is complete")
skipSetSourceShards := flagSet.Bool("skip_set_source_shards", false, "do not set the SourceShar field on destination shards")
if err := flagSet.Parse(args); err != nil {
return nil, fmt.Errorf("cannot parse strategy: %v", err)
}
if flagSet.NArg() > 0 {
return nil, fmt.Errorf("strategy doesn't have positional arguments")
}
return &SplitStrategy{
PopulateBlpCheckpoint: *populateBlpCheckpoint,
DontStartBinlogPlayer: *dontStartBinlogPlayer,
SkipSetSourceShards: *skipSetSourceShards,
}, nil
}