package zcash

import (
	"fmt"
	"runtime"
	"strings"
	"time"
)

type config struct {
	Title      string
	WalletInfo walletinfo `toml:"walletinfo"`
	Limit      limit      `toml:"limit"`
	ZcashRpc   zcashrpc   `toml:"zcashrpc"`
}
type limit struct {
	Fee string
}

type walletinfo struct {
	WalletKey string
}
type zcashrpc struct {
	Zcashrpcuser     string
	Zcashrpcpassword string
	Zcashhost        string
	Zcashport        int
}

func LOG(info string, format string, v ...interface{}) {

	_, file, line, _ := runtime.Caller(1)
	fpaths := strings.Split(file, "/")
	size := len(fpaths)
	var sysflag = "zcash package"
	if format == "" {
		fmt.Printf("%v |%v|%v|%v()|%v|%v\n", time.Now().Format("2006-01-02 15:04:05"), info, sysflag, fpaths[size-1], line, fmt.Sprintln(v...))
	} else {
		fmt.Printf("%v|%v|%v|%v|%v|%v\n", time.Now().Format("2006-01-02 15:04:05"), info, sysflag, fpaths[size-1], line, fmt.Sprintf(format, v...))
	}

}
