Родитель
7cb8870b07
Коммит
5662b0f44c
|
@ -238,6 +238,8 @@ var mountCmd = &cobra.Command{
|
|||
FlagErrorHandling: cobra.ExitOnError,
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
options.MountPath = common.ExpandPath(args[0])
|
||||
common.MountPath = options.MountPath
|
||||
|
||||
configFileExists := true
|
||||
|
||||
if options.ConfigFile == "" {
|
||||
|
|
|
@ -219,10 +219,11 @@ func (l *BaseLogger) logEvent(lvl string, format string, args ...interface{}) {
|
|||
// Only log if the log level matches the log request
|
||||
_, fn, ln, _ := runtime.Caller(3)
|
||||
msg := fmt.Sprintf(format, args...)
|
||||
msg = fmt.Sprintf("%s : %s[%d] : %s [%s (%d)]: %s",
|
||||
msg = fmt.Sprintf("%s : %s[%d] : [%s] %s [%s (%d)]: %s",
|
||||
time.Now().Format(time.UnixDate),
|
||||
l.fileConfig.LogTag,
|
||||
l.procPID,
|
||||
common.MountPath,
|
||||
lvl,
|
||||
filepath.Base(fn), ln,
|
||||
msg)
|
||||
|
|
|
@ -120,7 +120,7 @@ func getSyslogLevel(lvl common.LogLevel) syslog.Priority {
|
|||
func (l *SysLogger) write(lvl string, format string, args ...interface{}) {
|
||||
_, fn, ln, _ := runtime.Caller(3)
|
||||
msg := fmt.Sprintf(format, args...)
|
||||
l.logger.Print(lvl, " [", filepath.Base(fn), " (", ln, ")]: ", msg)
|
||||
l.logger.Print("[", common.MountPath, "] ", lvl, " [", filepath.Base(fn), " (", ln, ")]: ", msg)
|
||||
}
|
||||
|
||||
func (l *SysLogger) Debug(format string, args ...interface{}) {
|
||||
|
|
|
@ -91,6 +91,8 @@ var BfsDisabled = false
|
|||
var TransferPipe = "/tmp/transferPipe"
|
||||
var PollingPipe = "/tmp/pollPipe"
|
||||
|
||||
var MountPath string
|
||||
|
||||
// LogLevel enum
|
||||
type LogLevel int
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче