123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package bucash
- import (
- "fmt"
- "runtime"
- "strings"
- "time"
- )
- type config struct {
- Title string
- WalletInfo walletinfo `toml:"walletinfo"`
- Limit limit `toml:"limit"`
- Rpc rpc `toml:"rpc"`
- }
- type limit struct {
- Fee string
- }
- type walletinfo struct {
- WalletKey string
- }
- type rpc struct {
- Rpcuser string
- Rpcpassword string
- Rpchost string
- Rpcport int
- }
- func LOG(info string, format string, v ...interface{}) {
- _, file, line, _ := runtime.Caller(1)
- fpaths := strings.Split(file, "/")
- size := len(fpaths)
- var sysflag = "lite 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...))
- }
- }
|