blob: bc5e78d40f0a3ae4c6e59de9c4d53ec4dc1fd0db [file] [log] [blame]
Scott Baker2d897982019-09-24 11:50:08 -07001// +build lz4debug
2
3package lz4
4
5import (
6 "fmt"
7 "os"
8 "path/filepath"
9 "runtime"
10)
11
12const debugFlag = true
13
14func debug(args ...interface{}) {
15 _, file, line, _ := runtime.Caller(1)
16 file = filepath.Base(file)
17
18 f := fmt.Sprintf("LZ4: %s:%d %s", file, line, args[0])
19 if f[len(f)-1] != '\n' {
20 f += "\n"
21 }
22 fmt.Fprintf(os.Stderr, f, args[1:]...)
23}