blob: bc5e78d40f0a3ae4c6e59de9c4d53ec4dc1fd0db [file] [log] [blame]
Prince Pereirac1c21d62021-04-22 08:38:15 +00001// +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}