Add the migrationLogger struct

This commit is contained in:
Aayush Rajasekaran 2021-01-19 02:34:08 -05:00 committed by Steven Allen
parent 99ea5b62ea
commit f6a0da3751

View File

@ -5,6 +5,8 @@ import (
"context"
"encoding/binary"
"github.com/filecoin-project/go-state-types/rt"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
@ -52,6 +54,21 @@ type Upgrade struct {
type UpgradeSchedule []Upgrade
type migrationLogger struct{}
func (ml migrationLogger) Log(level rt.LogLevel, msg string, args ...interface{}) {
switch level {
case rt.DEBUG:
log.Debugf(msg, args...)
case rt.INFO:
log.Infof(msg, args...)
case rt.WARN:
log.Warnf(msg, args...)
case rt.ERROR:
log.Errorf(msg, args...)
}
}
func DefaultUpgradeSchedule() UpgradeSchedule {
var us UpgradeSchedule