forked from jwilder/docker-squash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog.go
More file actions
36 lines (29 loc) · 598 Bytes
/
log.go
File metadata and controls
36 lines (29 loc) · 598 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"fmt"
"os"
)
var verbose bool
func debugf(format string, args ...interface{}) {
if verbose {
fmt.Fprintf(os.Stderr, fmt.Sprintf("%s", format), args...)
}
}
func debug(args ...interface{}) {
if verbose {
fmt.Fprintln(os.Stderr, args...)
}
}
func fatalf(format string, args ...interface{}) {
fmt.Fprintf(os.Stderr, fmt.Sprintf("ERROR: %s", format), args...)
signals <- os.Interrupt
wg.Wait()
os.Exit(1)
}
func fatal(args ...interface{}) {
fmt.Fprint(os.Stderr, "ERROR: ")
fmt.Fprintln(os.Stderr, args...)
signals <- os.Interrupt
wg.Wait()
os.Exit(1)
}