Skip to content
Snippets Groups Projects
Commit 539ac9aa authored by Albumen's avatar Albumen
Browse files

refactor: use filepath to replace hard code

parent 69fad170
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
package nacos package nacos
import ( import (
"runtime" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
...@@ -37,7 +37,8 @@ import ( ...@@ -37,7 +37,8 @@ import (
"github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/common/logger"
) )
var logDir string // Nacos Log dir, it can be override when creating client by config_center.log_dir
var logDir = filepath.Join("logs", "nacos", "log")
// NacosClient Nacos client // NacosClient Nacos client
type NacosClient struct { type NacosClient struct {
...@@ -51,16 +52,6 @@ type NacosClient struct { ...@@ -51,16 +52,6 @@ type NacosClient struct {
onceClose func() onceClose func()
} }
// init default Nacos Log dir, it can be override when create client
func init() {
switch runtime.GOOS {
case "windows":
logDir = "logs\\nacos\\log"
default:
logDir = "logs/nacos/log"
}
}
// Client Get Client // Client Get Client
func (n *NacosClient) Client() *config_client.IConfigClient { func (n *NacosClient) Client() *config_client.IConfigClient {
return n.client return n.client
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment