mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
t6
This commit is contained in:
parent
a8982f9ec4
commit
7efc6fb012
1 changed files with 7 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ package log2
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"log"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -18,12 +18,16 @@ type TimingLog struct {
|
||||||
|
|
||||||
func InitOutputFile(outputFile string) {
|
func InitOutputFile(outputFile string) {
|
||||||
if outputFile == "" {
|
if outputFile == "" {
|
||||||
log.Fatalln("You must specify the log file, e.g. \"geth --timing.output=/path/to/file.txt\"")
|
fmt.Fprintln(os.Stderr, "You must specify the log file, e.g. \"geth --timing.output=/path/to/file.txt\"")
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
file, err = os.OpenFile(outputFile, os.O_APPEND|os.O_CREATE, 0644)
|
file, err = os.OpenFile(outputFile, os.O_APPEND|os.O_CREATE, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln("Fail to create log file for timing.")
|
fmt.Fprintln(os.Stderr, "Fail to create log file for timing.")
|
||||||
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func Record(timingLog TimingLog) error {
|
func Record(timingLog TimingLog) error {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue