1 // Copyright (c) 2014-2015 The Notify Authors. All rights reserved.
2 // Use of this source code is governed by the MIT license that can be
3 // found in the LICENSE file.
16 func dbgprint(v ...interface{}) {
22 func dbgprintf(format string, v ...interface{}) {
24 fmt.Printf(format, v...)
28 func dbgcallstack(max int) []string {
29 pc, stack := make([]uintptr, max), make([]string, 0, max)
30 runtime.Callers(2, pc)
31 for _, pc := range pc {
32 if f := runtime.FuncForPC(pc); f != nil {
34 idx := strings.LastIndex(fname, string(os.PathSeparator))
36 stack = append(stack, fname[idx+1:])
38 stack = append(stack, fname)