本文整理汇总了Golang中github.com/remogatto/mandala.Stacktrace函数的典型用法代码示例。如果您正苦于以下问题:Golang Stacktrace函数的具体用法?Golang Stacktrace怎么用?Golang Stacktrace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Stacktrace函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
mandala.Verbose = true
mandala.Debug = true
// Create rendering loop control channels
renderLoopControl := newRenderLoopControl()
// Start the rendering loop
loop.GoRecoverable(
renderLoopFunc(renderLoopControl),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
mandala.Logf("%s", r.Reason)
mandala.Logf("%s", mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
// Start the event loop
loop.GoRecoverable(
eventLoopFunc(renderLoopControl),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
mandala.Logf("%s", r.Reason)
mandala.Logf("%s", mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
}
开发者ID:remogatto,项目名称:mandala-examples,代码行数:32,代码来源:main_android.go
示例2: timeoutLoopFunc
func (t *TestSuite) timeoutLoopFunc() loop.LoopFunc {
return func(loop loop.Loop) error {
time := <-t.timeout
err := fmt.Errorf("Tests timed out after %v", time)
mandala.Logf("%s %s", err.Error(), mandala.Stacktrace())
t.Error(err)
return nil
}
}
开发者ID:leonardyp,项目名称:mandala,代码行数:9,代码来源:testlib.go
示例3: BeforeAll
func (t *TestSuite) BeforeAll() {
// Create rendering loop control channels
t.rlControl = newRenderLoopControl()
// Start the rendering loop
loop.GoRecoverable(
t.renderLoopFunc(t.rlControl),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
mandala.Logf("%s", r.Reason)
mandala.Logf("%s", mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
// Start the event loop
loop.GoRecoverable(
t.eventLoopFunc(t.rlControl),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
mandala.Logf("%s", r.Reason)
mandala.Logf("%s", mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
if t.timeout != nil {
// Start the timeout loop
loop.GoRecoverable(
t.timeoutLoopFunc(),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
mandala.Logf("%s", r.Reason)
mandala.Logf("%s", mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
}
}
开发者ID:remogatto,项目名称:gltext,代码行数:41,代码来源:testlib.go
示例4: main
func main() {
runtime.LockOSThread()
verbose := flag.Bool("verbose", false, "produce verbose output")
debug := flag.Bool("debug", false, "produce debug output")
size := flag.String("size", "320x480", "set the size of the window")
flag.Parse()
if *verbose {
mandala.Verbose = true
}
if *debug {
mandala.Debug = true
}
dims := strings.Split(strings.ToLower(*size), "x")
width, err := strconv.Atoi(dims[0])
if err != nil {
panic(err)
}
height, err := strconv.Atoi(dims[1])
if err != nil {
panic(err)
}
if !glfw.Init() {
panic("Can't init glfw!")
}
defer glfw.Terminate()
// Enable OpenGL ES 2.0.
glfw.WindowHint(glfw.ClientApi, glfw.OpenglEsApi)
glfw.WindowHint(glfw.ContextVersionMajor, 2)
window, err := glfw.CreateWindow(width, height, "{{.AppName}}", nil, nil)
if err != nil {
panic(err)
}
mandala.Init(window)
// Create a rendering loop control struct containing a set of
// channels that control rendering.
renderLoopControl := newRenderLoopControl()
// Start the rendering loop
loop.GoRecoverable(
renderLoopFunc(renderLoopControl),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
log.Printf("%s\n%s", r.Reason, mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
// Start the event loop
loop.GoRecoverable(
eventLoopFunc(renderLoopControl),
func(rs loop.Recoverings) (loop.Recoverings, error) {
for _, r := range rs {
log.Printf("%s\n%s", r.Reason, mandala.Stacktrace())
}
return rs, fmt.Errorf("Unrecoverable loop\n")
},
)
for !window.ShouldClose() {
glfw.WaitEvents()
}
}
开发者ID:remogatto,项目名称:mandala-template,代码行数:73,代码来源:main.go
注:本文中的github.com/remogatto/mandala.Stacktrace函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论