summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/pierrec/lz4/debug.go
blob: bc5e78d40f0a3ae4c6e59de9c4d53ec4dc1fd0db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// +build lz4debug

package lz4

import (
	"fmt"
	"os"
	"path/filepath"
	"runtime"
)

const debugFlag = true

func debug(args ...interface{}) {
	_, file, line, _ := runtime.Caller(1)
	file = filepath.Base(file)

	f := fmt.Sprintf("LZ4: %s:%d %s", file, line, args[0])
	if f[len(f)-1] != '\n' {
		f += "\n"
	}
	fmt.Fprintf(os.Stderr, f, args[1:]...)
}