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


Golang logger.GaugeLogger類代碼示例

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


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

示例1: StartRunnerAndMakeConnection

func StartRunnerAndMakeConnection(manifest *manifest.Manifest, log *logger.GaugeLogger, killChannel chan bool) (*TestRunner, error) {
	port, err := conn.GetPortFromEnvironmentVariable(common.GaugePortEnvName)
	if err != nil {
		port = 0
	}
	gaugeConnectionHandler, connHandlerErr := conn.NewGaugeConnectionHandler(port, nil)
	if connHandlerErr != nil {
		return nil, connHandlerErr
	}
	testRunner, err := startRunner(manifest, strconv.Itoa(gaugeConnectionHandler.ConnectionPortNumber()), log, killChannel)
	if err != nil {
		return nil, err
	}

	runnerConnection, connectionError := gaugeConnectionHandler.AcceptConnection(config.RunnerConnectionTimeout(), testRunner.ErrorChannel)
	testRunner.Connection = runnerConnection
	if connectionError != nil {
		log.Debug("Runner connection error: %s", connectionError)
		err := testRunner.killRunner()
		if err != nil {
			log.Debug("Error while killing runner: %s", err)
		}
		return nil, connectionError
	}
	return testRunner, nil
}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:26,代碼來源:runner.go

示例2: printStatus

func printStatus(executionResult *gauge_messages.ProtoExecutionResult, logger *logger.GaugeLogger) {
	logger.Error("Error Message: %s", executionResult.GetErrorMessage())

	stacktrace := executionResult.GetStackTrace()
	stacktrace = strings.Replace(stacktrace, "\n", "\n\t", -1)
	logger.Error("Stacktrace: %s", stacktrace)
}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:7,代碼來源:specExecutor.go

示例3: waitAndGetErrorMessage

func waitAndGetErrorMessage(errChannel chan error, cmd *exec.Cmd, log *logger.GaugeLogger) {
	go func() {
		err := cmd.Wait()
		if err != nil {
			log.Debug("Runner exited with error: %s", err)
			errChannel <- errors.New(fmt.Sprintf("Runner exited with error: %s\n", err.Error()))
		}
	}()
}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:9,代碼來源:runner.go

示例4: startStream

func (e *parallelSpecExecution) startStream(specs *specList, log *logger.GaugeLogger, suiteResultChannel chan *result.SuiteResult) {
	defer e.wg.Done()
	testRunner, err := runner.StartRunnerAndMakeConnection(e.manifest, log, make(chan bool))
	if err != nil {
		log.Error("Failed to start runner. Reason: %s", err.Error())
		suiteResultChannel <- &result.SuiteResult{UnhandledErrors: []error{errors.New(fmt.Sprintf("Failed to start runner. %s", err.Error()))}}
		return
	}
	simpleExecution := newSimpleExecution(&executionInfo{e.manifest, make([]*parser.Specification, 0), testRunner, e.pluginHandler, nil, log, e.errMaps})
	result := simpleExecution.executeStream(specs)
	suiteResultChannel <- result
}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:12,代碼來源:parallelExecution.go

示例5: setStepFailure

func setStepFailure(executionInfo *gauge_messages.ExecutionInfo, logger *logger.GaugeLogger) {
	setScenarioFailure(executionInfo)
	logger.Error("Failed step: %s", executionInfo.CurrentStep.Step.GetActualStepText())
	executionInfo.CurrentStep.IsFailed = proto.Bool(true)
}
開發者ID:krwhitney,項目名稱:gauge,代碼行數:5,代碼來源:specExecutor.go

示例6: printStatus

func printStatus(executionResult *gauge_messages.ProtoExecutionResult, logger logger.GaugeLogger) {
	logger.Error("Error Message: %s", executionResult.GetErrorMessage())
	stacktrace := executionResult.GetStackTrace()
	logger.Error("Stacktrace: %s", stacktrace)
}
開發者ID:jasonchaffee,項目名稱:gauge,代碼行數:5,代碼來源:specExecutor.go


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