|
@@ -60,13 +60,13 @@ func (f *FIFOBuffer) Push(value int) {
|
|
|
f.data[f.index] = value
|
|
|
f.index++
|
|
|
if f.index > len(f.data) {
|
|
|
- panic(fmt.Sprintf("Exceeded FIFOBuffer size %d %#v", len(f.data), f))
|
|
|
+ log.Panicf("Exceeded FIFOBuffer size %d %#v", len(f.data), f)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (f *FIFOBuffer) Pop() int {
|
|
|
if f.index == 0 {
|
|
|
- panic("Pop from empty FIFOBuffer.")
|
|
|
+ log.Panic("Pop from empty FIFOBuffer.")
|
|
|
}
|
|
|
f.index--
|
|
|
return f.data[f.index]
|
|
@@ -94,7 +94,7 @@ func (b *LIFOBuffer) Push(value int) {
|
|
|
|
|
|
func (b *LIFOBuffer) Pop() int {
|
|
|
if b.index == 0 {
|
|
|
- panic("Attempting to Pop from empty LIFOBuffer.")
|
|
|
+ log.Panic("Attempting to Pop from empty LIFOBuffer.")
|
|
|
}
|
|
|
|
|
|
b.index--
|
|
@@ -155,7 +155,7 @@ func (d *Door) TimeUsed() time.Duration {
|
|
|
func (d *Door) ReadDropfile(filename string) {
|
|
|
file, err := os.Open(filename)
|
|
|
if err != nil {
|
|
|
- panic(fmt.Sprintf("Open(%s): %s\n", filename, err))
|
|
|
+ log.Panicf("Open(%s): %s\n", filename, err)
|
|
|
// os.Exit(2)
|
|
|
}
|
|
|
|
|
@@ -285,7 +285,7 @@ func (d *Door) Init(doorname string) {
|
|
|
logfilename := fmt.Sprintf("%s-%d.log", doorname, d.Config.Node)
|
|
|
logf, err := os.OpenFile(logfilename, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0666)
|
|
|
if err != nil {
|
|
|
- panic(fmt.Sprintf("Error creating log file %s: %v", logfilename, err))
|
|
|
+ log.Panicf("Error creating log file %s: %v", logfilename, err)
|
|
|
}
|
|
|
|
|
|
log.SetOutput(logf)
|