Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Nacos client logDir path seperator #591

Merged
merged 3 commits into from
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion before_ut.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set zkJarPath=remoting/zookeeper/zookeeper-4unittest/contrib/fatjar
set zkJar=%zkJarPath%/%zkJarName%

if not exist "%zkJar%" (
md %zkJarPath%
md "%zkJarPath%"
curl -L %remoteJarUrl% -o %zkJar%
)

Expand Down
12 changes: 11 additions & 1 deletion config_center/nacos/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package nacos

import (
"runtime"
"strconv"
"strings"
"sync"
Expand All @@ -36,7 +37,7 @@ import (
"github.com/apache/dubbo-go/common/logger"
)

const logDir = "logs/nacos/log"
var logDir string

// NacosClient Nacos client
type NacosClient struct {
Expand All @@ -50,6 +51,15 @@ type NacosClient struct {
onceClose func()
}

func init() {
switch runtime.GOOS {
case "windows":
logDir = "logs\\nacos\\log"
default:
logDir = "logs/nacos/log"
}
AlbumenJ marked this conversation as resolved.
Show resolved Hide resolved
}

AlbumenJ marked this conversation as resolved.
Show resolved Hide resolved
// Client Get Client
func (n *NacosClient) Client() *config_client.IConfigClient {
return n.client
Expand Down