예제 #1
0
파일: main.go 프로젝트: rdrew4/cfops
func init() {

	if logLevel = os.Getenv(logLevelEnv); logLevel != "" {
		log.SetLogLevel(logLevel)
		logger = log.LogFactory("cfops cli", log.Lager, os.Stdout)
		logger.Debug("log level set", log.Data{"level": logLevel})
		cfops.SetLogger(logger)
	}
}
예제 #2
0
func init() {
	ExitCode = cleanExitCode

	if logLevel = os.Getenv(logLevelEnv); logLevel != "" {
		log.SetLogLevel(logLevel)
		logger = log.LogFactory("cfdatamanager cli", log.Lager, os.Stdout)
		logger.Debug("log level set", log.Data{"level": logLevel})
		cfdatamanager.SetLogger(logger)
	}
}
예제 #3
0
func getLogger(minLogLevel string) log.Logger {
	log.SetLogLevel(minLogLevel)
	return log.LogFactory("TestLogger", log.Lager, os.Stdout)
}
예제 #4
0
func NewTestLogger(component string) *TestLogger {
	buffer := gbytes.NewBuffer()
	testSink := NewTestSink(buffer)
	logger := log.LogFactory(component, log.Lager, buffer)
	return &TestLogger{logger, testSink}
}
예제 #5
0
func init() {
	backupLogger = log.LogFactory("cfbackup default logger", log.Lager, os.Stdout)
}
예제 #6
0
파일: tile_runner.go 프로젝트: rdrew4/cfops
const (
	ErrUnsupportedTileFormat = "you have a unsupported tile in your list: %s"
	loggerName               = "cfops"
	Restore                  = "restore"
	Backup                   = "backup"
	OpsMgr                   = "OPSMANAGER"
	ER                       = "ER"
)

var (
	BuiltinPipelineExecution = map[string]func(string, string, string, string, string) error{
		Restore: cfbackup.RunRestorePipeline,
		Backup:  cfbackup.RunBackupPipeline,
	}
	SupportedTiles map[string]func() (Tile, error)
	backupLogger   log.Logger = log.LogFactory("cfops default logger", log.Lager, os.Stdout)
)

func ErrUnsupportedTile(errString string) error {
	return fmt.Errorf(ErrUnsupportedTileFormat, errString)
}

type Tile interface {
	Backup() error
	Restore() error
}

func hasTilelistFlag(fs flagSet) bool {
	return (fs.Tilelist() != "")
}