本文整理匯總了Golang中log.Logger.New方法的典型用法代碼示例。如果您正苦於以下問題:Golang Logger.New方法的具體用法?Golang Logger.New怎麽用?Golang Logger.New使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類log.Logger
的用法示例。
在下文中一共展示了Logger.New方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
package pezauth_test
import (
"log"
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/pivotal-pez/pezauth/service"
)
var _ = Describe("create org", func() {
Context("calling .SafeCreate() w/ successfull rest calls", func() {
var (
username = "[email protected]"
log *log.Logger = log.New(os.Stdout, "logger: ", log.Lshortfile)
store *mockOrgPersistence = &mockOrgPersistence{
CalledUpsert: 0,
}
authClient AuthRequestCreator = &mockAuthRequestCreator{
MyMockDoer: NewMockDoer(),
}
)
It("should write a record to mongo and not error", func() {
org := NewOrg(username, log, nil, store, authClient)
_, err := org.SafeCreate()
Ω(err).Should(BeNil())
Ω(store.CalledUpsert).Should(Equal(1))
})
})