예제 #1
0
파일: main.go 프로젝트: m120/minio
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", minioReleaseTag)
	probe.SetAppInfo("Commit-ID", minioShortCommitID)
	if os.Getenv("DOCKERIMAGE") == "1" {
		probe.SetAppInfo("Docker-Image", "true")
	}

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		// Sets new config folder.
		setGlobalConfigPath(c.GlobalString("config-folder"))

		// Valid input arguments to main.
		checkMainSyntax(c)

		// Migrate any old version of config / state files to newer format.
		migrate()

		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
예제 #2
0
func (s *MySuite) TestProbe(c *C) {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", "RELEASE.Sat-19-Sep-2015-06-15-16-GMT")
	es := testDummy2().Trace("TopOfStack")
	// Uncomment the following Println to visually test probe call trace.
	// fmt.Println("Expecting a simulated error here.", es)
	c.Assert(es, Not(Equals), nil)

	newES := es.Trace()
	c.Assert(newES, Not(Equals), nil)
}
예제 #3
0
파일: probe_test.go 프로젝트: fwessels/mc
func (s *MySuite) TestProbe(c *C) {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Commit-ID", "7390cc957239")
	es := testDummy2().Trace("TopOfStack")
	// Uncomment the following Println to visually test probe call trace.
	// fmt.Println("Expecting a simulated error here.", es)
	c.Assert(es, Not(Equals), nil)

	newES := es.Trace()
	c.Assert(newES, Not(Equals), nil)
}
예제 #4
0
파일: main.go 프로젝트: zhujo01/minio
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", minioReleaseTag)

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		globalJSONFlag = c.GlobalBool("json")
		migrate()
		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
예제 #5
0
파일: main.go 프로젝트: winchram/minio-xl
func main() {
	// Initialize probe.
	probe.Init()
	// Include release tag in the debug dumps.
	probe.SetAppInfo("Commit", minioShortCommitID)

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		globalJSONFlag = c.GlobalBool("json")
		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
예제 #6
0
파일: main.go 프로젝트: seiflotfy/minio
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", minioReleaseTag)
	probe.SetAppInfo("Commit-ID", minioShortCommitID)
	if os.Getenv("DOCKERIMAGE") == "1" {
		probe.SetAppInfo("Docker-Image", "true")
	}

	app := registerApp()
	app.Before = func(c *cli.Context) error {
		globalJSONFlag = c.GlobalBool("json")
		migrate()
		return nil
	}
	app.ExtraInfo = func() map[string]string {
		return getSystemData()
	}

	app.RunAndExitOnError()
}
예제 #7
0
파일: main.go 프로젝트: zhujo01/mc
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", mcReleaseTag)

	app := registerApp()
	app.Before = registerBefore

	app.ExtraInfo = func() map[string]string {
		if _, e := ts.GetSize(); e != nil {
			globalQuietFlag = true
		}

		if globalDebugFlag {
			return getSystemData()
		}
		return make(map[string]string)
	}

	app.RunAndExitOnError()
}
예제 #8
0
파일: main.go 프로젝트: fwessels/mc
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", mcReleaseTag)
	probe.SetAppInfo("Commit", mcShortCommitID)

	contentdb.Init() // Load contentdb into memory.
	app := registerApp()
	app.Before = registerBefore

	app.ExtraInfo = func() map[string]string {
		if _, e := ts.GetSize(); e != nil {
			globalQuiet = true
		}
		if globalDebug {
			return getSystemData()
		}
		return make(map[string]string)
	}

	app.RunAndExitOnError()
}