mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-14 22:18:17 +08:00
add stderr redirection, add logo
This commit is contained in:
@@ -6,13 +6,18 @@ import (
|
||||
"path"
|
||||
)
|
||||
|
||||
const VERSION = "alpha 0.8.4"
|
||||
const (
|
||||
ProgramName = "卡西米尔唱片机"
|
||||
Version = "alpha 0.8.4"
|
||||
)
|
||||
|
||||
const CONFIG_PATH = "./config.ini"
|
||||
const Assests_PATH = "./assets"
|
||||
const (
|
||||
ConfigPath = "./config.ini"
|
||||
AssetsPath = "./assets"
|
||||
)
|
||||
|
||||
func GetAssetPath(name string) string {
|
||||
return path.Join(Assests_PATH, name)
|
||||
return path.Join(AssetsPath, name)
|
||||
}
|
||||
|
||||
type Config interface {
|
||||
@@ -33,7 +38,7 @@ func LoadConfig(cfg Config) {
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
ConfigFile, err = ini.Load(CONFIG_PATH)
|
||||
ConfigFile, err = ini.Load(ConfigPath)
|
||||
if err != nil {
|
||||
fmt.Println("config not found, using default config")
|
||||
ConfigFile = ini.Empty()
|
||||
|
||||
@@ -3,8 +3,9 @@ package config
|
||||
import "github.com/sirupsen/logrus"
|
||||
|
||||
type _LogConfig struct {
|
||||
Path string
|
||||
Level logrus.Level
|
||||
Path string
|
||||
Level logrus.Level
|
||||
RedirectStderr bool
|
||||
}
|
||||
|
||||
func (c *_LogConfig) Name() string {
|
||||
@@ -12,6 +13,7 @@ func (c *_LogConfig) Name() string {
|
||||
}
|
||||
|
||||
var Log = &_LogConfig{
|
||||
Path: "./log.txt",
|
||||
Level: logrus.InfoLevel,
|
||||
Path: "./log.txt",
|
||||
Level: logrus.InfoLevel,
|
||||
RedirectStderr: false, // this should be true if it is in production mode.
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func TestCreate(t *testing.T) {
|
||||
fmt.Println(SaveToConfigFile(CONFIG_PATH))
|
||||
fmt.Println(SaveToConfigFile(ConfigPath))
|
||||
}
|
||||
|
||||
func TestLoad(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user