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


Golang TestLogger.Info方法代碼示例

本文整理匯總了Golang中github.com/pivotal-golang/lager/lagertest.TestLogger.Info方法的典型用法代碼示例。如果您正苦於以下問題:Golang TestLogger.Info方法的具體用法?Golang TestLogger.Info怎麽用?Golang TestLogger.Info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/pivotal-golang/lager/lagertest.TestLogger的用法示例。


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

示例1:

			PingStub: func() error {
				return <-pingErrors
			},
		}
		resources := executor.ExecutorResources{MemoryMB: 128, DiskMB: 1024, Containers: 6}
		fakeClient.TotalResourcesReturns(resources, nil)

		logger = lagertest.NewTestLogger("test")
		clock = fakeclock.NewFakeClock(time.Now())

		heartbeaterErrors = make(chan error)
		observedSignals = make(chan os.Signal, 2)
		fakeHeartbeater = &maintain_fakes.FakeRunner{
			RunStub: func(sigChan <-chan os.Signal, ready chan<- struct{}) error {
				defer GinkgoRecover()
				logger.Info("fake-heartbeat-started")
				close(ready)
				for {
					select {
					case sig := <-sigChan:
						logger.Info("fake-heartbeat-received-signal")
						Eventually(observedSignals, time.Millisecond).Should(BeSent(sig))
						return nil
					case err := <-heartbeaterErrors:
						logger.Info("fake-heartbeat-received-error")
						return err
					}
				}
			},
		}
開發者ID:emc-xchallenge,項目名稱:rep,代碼行數:30,代碼來源:maintain_test.go

示例2:

			}
			err := routingApiClient.UpsertTcpRouteMappings([]db.TcpRouteMapping{tcpRouteMapping})
			Expect(err).ToNot(HaveOccurred())

			tcpRouteMappings, err := routingApiClient.TcpRouteMappings()
			Expect(err).NotTo(HaveOccurred())
			Expect(tcpRouteMappings).To(ContainElement(tcpRouteMapping))

			allOutput := logger.Buffer()
			runner := testrunner.New(routerConfigurerPath, routerConfigurerArgs)
			session, err = gexec.Start(runner.Command, allOutput, allOutput)
			Expect(err).ToNot(HaveOccurred())
		})

		AfterEach(func() {
			logger.Info("shutting-down")
			session.Signal(os.Interrupt)
			Eventually(session.Exited, 5*time.Second).Should(BeClosed())
			server.Signal(os.Interrupt)
			Eventually(server.Wait(), 5*time.Second).Should(Receive())
			oauthServer.Close()
		})

		It("syncs with routing api", func() {
			Eventually(session.Out, 5*time.Second).Should(gbytes.Say("applied-fetched-routes-to-routing-table"))
			expectedConfigEntry := "\nlisten listen_cfg_5222\n  mode tcp\n  bind :5222\n"
			serverConfigEntry := "server server_some-ip-1_61000 some-ip-1:61000"
			verifyHaProxyConfigContent(haproxyConfigFile, expectedConfigEntry)
			verifyHaProxyConfigContent(haproxyConfigFile, serverConfigEntry)
		})
開發者ID:jmptrader,項目名稱:cf-tcp-router,代碼行數:30,代碼來源:main_test.go


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