bucashconfig.go 901 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package bucash
  2. import (
  3. "fmt"
  4. "runtime"
  5. "strings"
  6. "time"
  7. )
  8. type config struct {
  9. Title string
  10. WalletInfo walletinfo `toml:"walletinfo"`
  11. Limit limit `toml:"limit"`
  12. Rpc rpc `toml:"rpc"`
  13. }
  14. type limit struct {
  15. Fee string
  16. }
  17. type walletinfo struct {
  18. WalletKey string
  19. }
  20. type rpc struct {
  21. Rpcuser string
  22. Rpcpassword string
  23. Rpchost string
  24. Rpcport int
  25. }
  26. func LOG(info string, format string, v ...interface{}) {
  27. _, file, line, _ := runtime.Caller(1)
  28. fpaths := strings.Split(file, "/")
  29. size := len(fpaths)
  30. var sysflag = "lite package"
  31. if format == "" {
  32. 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...))
  33. } else {
  34. 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...))
  35. }
  36. }