Documentation ¶
Overview ¶
Author: Kernel.Huang Mail: kernelman79@gmail.com Date: 3/18/21 1:01 PM Package: log
Author: Kernel.Huang Mail: kernelman79@gmail.com Date: 3/18/21 1:01 PM
Author: Kernel.Huang Mail: kernelman79@gmail.com File: config.go Date: 8/9/22 1:57 PM
Index ¶
- Constants
- Variables
- func BootLogger() (err error)
- func CloseLogger()
- func CurrentAndAbsPath() string
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatally(v ...interface{})
- func GetAbsPath(current string) string
- func GetConfigDir() string
- func GetConfigPath() string
- func GetCurrentDir() string
- func GetCustomConfigDir(dirname string) string
- func GetCustomConfigPath(dirname string, filename string) string
- func GetLastPath(currentPath string) string
- func GetLogsDir() string
- func GetLogsFilename() string
- func GetLogsLevel() string
- func GetLogsPrefix() string
- func GetRootPath() string
- func Info(format string, v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func SetCurrentPath() string
- func Trace(format string, v ...interface{})
- func Warning(format string, v ...interface{})
- type LEVEL
- type LoggerConf
- type TomlConfig
- func (tf *TomlConfig) AtBool() bool
- func (tf *TomlConfig) AtInt() int
- func (tf *TomlConfig) AtStr() string
- func (tf *TomlConfig) Fetch(key string) *TomlConfig
- func (tf *TomlConfig) Get(key string) *TomlConfig
- func (tf *TomlConfig) NewToml(dirname string, filename string) *TomlConfig
- func (tf *TomlConfig) Read(key string) *TomlConfig
- func (tf *TomlConfig) To() interface{}
- func (tf *TomlConfig) ToBool() bool
- func (tf *TomlConfig) ToInt() int
- func (tf *TomlConfig) ToStr() string
- func (tf *TomlConfig) Zone(key string) *TomlConfig
Constants ¶
const DateFormat = "2006-01-02"
const TimeFormat = "2006-01-02 15:04:05"
Variables ¶
var Toml = new(TomlConfig)
Functions ¶
func GetCustomConfigPath ¶
Get config path
Types ¶
type LoggerConf ¶
type TomlConfig ¶
type TomlConfig struct { Structured interface{} // contains filtered or unexported fields }
func (*TomlConfig) AtBool ¶
func (tf *TomlConfig) AtBool() bool
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtBool()
func (*TomlConfig) AtInt ¶
func (tf *TomlConfig) AtInt() int
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtInt()
func (*TomlConfig) AtStr ¶
func (tf *TomlConfig) AtStr() string
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").AtStr()
func (*TomlConfig) Fetch ¶
func (tf *TomlConfig) Fetch(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Fetch("key").ToStr()
func (*TomlConfig) Get ¶
func (tf *TomlConfig) Get(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").To()
func (*TomlConfig) NewToml ¶
func (tf *TomlConfig) NewToml(dirname string, filename string) *TomlConfig
func (*TomlConfig) Read ¶
func (tf *TomlConfig) Read(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToStr() or ToInt()
func (*TomlConfig) To ¶
func (tf *TomlConfig) To() interface{}
*
- Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").To()
func (*TomlConfig) ToBool ¶
func (tf *TomlConfig) ToBool() bool
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToBool()
func (*TomlConfig) ToInt ¶
func (tf *TomlConfig) ToInt() int
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToInt()
func (*TomlConfig) ToStr ¶
func (tf *TomlConfig) ToStr() string
Example: result := Tome.NewToml(dirname, filename).Read("zoneName.key").ToStr()
func (*TomlConfig) Zone ¶
func (tf *TomlConfig) Zone(key string) *TomlConfig
Example: result := Tome.NewToml(dirname, filename).Zone("zoneName").Get("key").To()