Documentation ¶
Index ¶
- Constants
- func FilePath(file string) (real string, err error)
- func GetPasswd() []byte
- func IsDir(path string) bool
- func JustifyText(text string, width int) []string
- func SplitBySpace(str string) []string
- func WrapCmd(cmd, before, after string) string
- func WrapCmdAfter(cmd, after string) string
- func WrapCmdBefore(cmd, before string) string
- type Logger
- func (logger *Logger) Debug(format string, v ...interface{})
- func (logger *Logger) Fatal(format string, v ...interface{})
- func (logger *Logger) Info(format string, v ...interface{})
- func (logger *Logger) Log(prefix string, format string, v ...interface{})
- func (logger *Logger) SetLevel(level int)
- func (logger *Logger) Trace(format string, v ...interface{})
- func (logger *Logger) Warn(format string, v ...interface{})
Constants ¶
View Source
const ( TRACE = iota DEBUG INFO WARN ERROR FATAL )
Log Level
Variables ¶
This section is empty.
Functions ¶
func JustifyText ¶
JustifyText splits a string into array with each item has the same length.
func WrapCmdAfter ¶
WrapCmdAfter appends `&& after` for cmd
func WrapCmdBefore ¶
WrapCmdBefore adds `before &&` before cmd
Types ¶
type Logger ¶
Logger is a simple logger
func NewLogger ¶
NewLogger returns a logger @filepath log's full path, mkdirp if dirname does not exists. Use stdout if is empty.
Click to show internal directories.
Click to hide internal directories.