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) } }
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) } }
func getLogger(minLogLevel string) log.Logger { log.SetLogLevel(minLogLevel) return log.LogFactory("TestLogger", log.Lager, os.Stdout) }
func NewTestLogger(component string) *TestLogger { buffer := gbytes.NewBuffer() testSink := NewTestSink(buffer) logger := log.LogFactory(component, log.Lager, buffer) return &TestLogger{logger, testSink} }
func init() { backupLogger = log.LogFactory("cfbackup default logger", log.Lager, os.Stdout) }
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() != "") }