當前位置: 首頁>>代碼示例>>Golang>>正文


Golang shinylog.Red函數代碼示例

本文整理匯總了Golang中github.com/burke/zeus/go/shinylog.Red函數的典型用法代碼示例。如果您正苦於以下問題:Golang Red函數的具體用法?Golang Red怎麽用?Golang Red使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Red函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: ErrorConfigCommandCouldntStart

func ErrorConfigCommandCouldntStart(output string) {
	slog.Red("Failed to initialize application from {yellow}zeus.json{red}.")
	if slog.Red("The json file is valid, but the {yellow}command{red} could not be started:") {
		fmt.Println(output)
		ExitNow(1)
	}
}
開發者ID:rschmukler,項目名稱:zeus,代碼行數:7,代碼來源:errors.go

示例2: ErrorConfigCommandCrashed

func ErrorConfigCommandCrashed(output string) {
	slog.Red("Failed to initialize application from {yellow}zeus.json{red}.")
	if slog.Red("The json file is valid, but the {yellow}command{red} terminated with this output:") {
		fmt.Println(output)
		ExitNow(1)
	}
}
開發者ID:rschmukler,項目名稱:zeus,代碼行數:7,代碼來源:errors.go

示例3: ErrorConfigCommandCrashed

func ErrorConfigCommandCrashed(output string) {
	if !suppressErrors {
		slog.Red("Failed to initialize application from " + yellow + "zeus.json" + red + ".")
		slog.Red("The json file is valid, but the " + yellow + "command" + red + " terminated with this output:")
		fmt.Println(output)
		ExitNow(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:8,代碼來源:errors.go

示例4: ErrorConfigCommandCouldntStart

func ErrorConfigCommandCouldntStart(output string) {
	if !suppressErrors {
		slog.Red("Failed to initialize application from " + yellow + "zeus.json" + red + ".")
		slog.Red("The json file is valid, but the " + yellow + "command" + red + " could not be started:")
		fmt.Println(output)
		ExitNow(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:8,代碼來源:errors.go

示例5: startWrapper

func startWrapper(filesChanged chan string) *exec.Cmd {
	path := executablePath()
	cmd := exec.Command(path[0], path[1:]...)
	var err error
	if watcherIn, err = cmd.StdinPipe(); err != nil {
		terminate(err.Error())
	}
	if watcherOut, err = cmd.StdoutPipe(); err != nil {
		terminate(err.Error())
	}
	if watcherErr, err = cmd.StderrPipe(); err != nil {
		terminate(err.Error())
	}

	cmd.Start()

	go func() {
		buf := make([]byte, 2048)
		for {
			n, err := watcherOut.Read(buf)
			if err != nil {
				time.Sleep(500 * time.Millisecond)
				slog.Red("Failed to read from FileSystem watcher process: " + err.Error())
			}
			message := strings.TrimSpace(string(buf[:n]))
			files := strings.Split(message, "\n")
			for _, file := range files {
				filesChanged <- file
			}
		}
	}()

	go func() {
		err := cmd.Wait()
		// gross, but this is an easy way to work around the case where
		// signal propagation hits the wrapper before the master disables logging
		time.Sleep(100 * time.Millisecond)
		terminate("The FS watcher process crashed: " + err.Error())
	}()

	return cmd
}
開發者ID:shalecraig,項目名稱:zeus,代碼行數:42,代碼來源:filemonitor.go

示例6: Error

func Error(msg string) {
	if slog.Red(msg) {
		ExitNow(1)
	}
}
開發者ID:rschmukler,項目名稱:zeus,代碼行數:5,代碼來源:errors.go

示例7: errorFailedReadFromWatcher

func errorFailedReadFromWatcher(err error) {
	if !suppressErrors {
		slog.Red("Failed to read from FileSystem watcher process: " + err.Error())
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:5,代碼來源:errors.go

示例8: ErrorFileMonitorWrapperCrashed

func ErrorFileMonitorWrapperCrashed(err error) {
	if !suppressErrors {
		slog.Red("The FileSystem watcher process crashed: " + err.Error())
		ExitNow(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:6,代碼來源:errors.go

示例9: ErrorCantCreateListener

func ErrorCantCreateListener() {
	if !suppressErrors {
		slog.Red("It looks like Zeus is already running. If not, remove " + yellow + ".zeus.sock" + red + " and try again.")
		ExitNow(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:6,代碼來源:errors.go

示例10: errorUnableToAcceptSocketConnection

func errorUnableToAcceptSocketConnection() {
	if !suppressErrors {
		slog.Red("Unable to accept socket connection.")
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:5,代碼來源:errors.go

示例11: ErrorConfigFileInvalidJson

func ErrorConfigFileInvalidJson() {
	if !suppressErrors {
		slog.Red("The config file " + yellow + "zeus.json" + red + " contains invalid JSON and could not be parsed.")
		os.Exit(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:6,代碼來源:errors.go

示例12: ErrorConfigFileInvalidFormat

func ErrorConfigFileInvalidFormat() {
	if !suppressErrors {
		slog.Red("The config file " + yellow + "zeus.json" + red + " is not in the correct format.")
		os.Exit(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:6,代碼來源:errors.go

示例13: ErrorConfigCommandCrashed

func ErrorConfigCommandCrashed(output string) {
	ExitNow(1, func() {
		slog.Red("Couldn't boot application. {yellow}command{red} terminated with this output:")
		fmt.Println(output)
	})
}
開發者ID:nevir,項目名稱:zeus,代碼行數:6,代碼來源:zerror.go

示例14: ErrorConfigFileMissing

// The config file is loaded before any goroutines arything is done that requires cleanup,
// and our exitNow goroutine has not been spawned yet, so we will just explicitly exit
// in the json-related errors..
func ErrorConfigFileMissing() {
	if !suppressErrors {
		slog.Red("Required config file " + yellow + "zeus.json" + red + " not found in the current directory.")
		os.Exit(1)
	}
}
開發者ID:Epictetus,項目名稱:zeus,代碼行數:9,代碼來源:errors.go

示例15: ErrorCantConnectToMaster

func ErrorCantConnectToMaster() {
	slog.Red("Can't connect to master. Run {yellow}zeus start{red} first.\r")
	os.Exit(1)
}
開發者ID:rschmukler,項目名稱:zeus,代碼行數:4,代碼來源:errors.go


注:本文中的github.com/burke/zeus/go/shinylog.Red函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。