mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-10-01 00:06:11 -04:00
Line separator
This commit is contained in:
parent
dc7d4a2309
commit
3bd4238e88
@ -4,6 +4,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/v2ray/v2ray-core/common/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -35,8 +37,7 @@ func (l *streamLogger) WriteLog(prefix, format string, v ...interface{}) {
|
|||||||
} else {
|
} else {
|
||||||
data = fmt.Sprintf(format, v...)
|
data = fmt.Sprintf(format, v...)
|
||||||
}
|
}
|
||||||
l.writer.Write([]byte(prefix + data))
|
l.writer.Write([]byte(prefix + data + platform.LineSeparator()))
|
||||||
l.writer.Write([]byte{'\n'})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -6,11 +6,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
type otherPlatformEnvironment struct {
|
func ExpandEnv(s string) string {
|
||||||
}
|
|
||||||
|
|
||||||
var environmentInstance = &otherPlatformEnvironment{}
|
|
||||||
|
|
||||||
func (e *otherPlatformEnvironment) ExpandEnv(s string) string {
|
|
||||||
return os.ExpandEnv(s)
|
return os.ExpandEnv(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LineSeparator() string {
|
||||||
|
return "\n"
|
||||||
|
}
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
// Package platform provides platform specific functionalities.
|
|
||||||
package platform
|
|
||||||
|
|
||||||
type environment interface {
|
|
||||||
ExpandEnv(s string) string
|
|
||||||
}
|
|
||||||
|
|
||||||
func ExpandEnv(s string) string {
|
|
||||||
return environmentInstance.ExpandEnv(s)
|
|
||||||
}
|
|
@ -2,16 +2,11 @@
|
|||||||
|
|
||||||
package platform
|
package platform
|
||||||
|
|
||||||
import (
|
func ExpandEnv(s string) string {
|
||||||
"os"
|
|
||||||
)
|
|
||||||
|
|
||||||
type windowsEnvironment struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
var environmentInstance = &windowsEnvironment{}
|
|
||||||
|
|
||||||
func (e *windowsEnvironment) ExpandEnv(s string) string {
|
|
||||||
// TODO
|
// TODO
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LineSeparator() string {
|
||||||
|
return "\r\n"
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user