This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git
The following commit(s) were added to refs/heads/master by this push:
new 00a5e0e upgrade go chassis (#159)
00a5e0e is described below
commit 00a5e0eeee83e943b55632b4ab6b1e308f930dda
Author: Shawn <[email protected]>
AuthorDate: Wed Sep 2 15:55:15 2020 +0800
upgrade go chassis (#159)
---
cmd/kieserver/main.go | 10 ++---
go.mod | 9 +++--
go.sum | 42 ++++++++++++++++++++
server/handler/track_handler.go | 10 ++---
server/plugin/qms/quota.go | 6 +--
server/pubsub/bus.go | 16 ++++----
server/pubsub/event_handler.go | 10 ++---
server/rbac/rbac.go | 18 ++++-----
server/resource/v1/admin_resource.go | 8 ++--
server/resource/v1/admin_resource_test.go | 2 +-
server/resource/v1/common.go | 12 +++---
server/resource/v1/doc_struct.go | 2 +-
server/resource/v1/history_resource.go | 10 ++---
server/resource/v1/history_resource_test.go | 6 +--
server/resource/v1/kv_resource.go | 38 +++++++++---------
server/resource/v1/kv_resource_test.go | 10 ++---
server/server.go | 16 ++++----
server/service/mongo/counter/revision.go | 8 ++--
server/service/mongo/history/dao.go | 14 +++----
server/service/mongo/init.go | 4 +-
server/service/mongo/kv/kv_dao.go | 50 ++++++++++++------------
server/service/mongo/kv/kv_service.go | 12 +++---
server/service/mongo/kv/kv_service_test.go | 6 +--
server/service/mongo/session/session.go | 30 +++++++-------
server/service/mongo/track/polling_detail_dao.go | 4 +-
server/service/mongo/view/view_dao.go | 8 ++--
server/service/mongo/view/view_service.go | 16 ++++----
27 files changed, 210 insertions(+), 167 deletions(-)
diff --git a/cmd/kieserver/main.go b/cmd/kieserver/main.go
index 4810199..34328e0 100644
--- a/cmd/kieserver/main.go
+++ b/cmd/kieserver/main.go
@@ -22,12 +22,12 @@ import (
"github.com/apache/servicecomb-kie/server"
"github.com/apache/servicecomb-kie/server/command"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
//custom handlers
_ "github.com/apache/servicecomb-kie/server/handler"
- _ "github.com/go-chassis/go-chassis/middleware/jwt"
- _ "github.com/go-chassis/go-chassis/middleware/monitoring"
- _ "github.com/go-chassis/go-chassis/middleware/ratelimiter"
+ _ "github.com/go-chassis/go-chassis/v2/middleware/jwt"
+ _ "github.com/go-chassis/go-chassis/v2/middleware/monitoring"
+ _ "github.com/go-chassis/go-chassis/v2/middleware/ratelimiter"
//storage
_ "github.com/apache/servicecomb-kie/server/service/mongo"
//quota management
@@ -36,7 +36,7 @@ import (
func main() {
if err := command.ParseConfig(os.Args); err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
server.Run()
diff --git a/go.mod b/go.mod
index 2ab2da5..dedebc2 100644
--- a/go.mod
+++ b/go.mod
@@ -3,10 +3,11 @@ module github.com/apache/servicecomb-kie
require (
github.com/apache/servicecomb-service-center
v0.0.0-20200817025835-7bb8c4eb9421
github.com/emicklei/go-restful v2.12.0+incompatible
- github.com/go-chassis/go-archaius v1.3.2
- github.com/go-chassis/go-chassis v0.0.0-20200826064053-d90be848aa10
+ github.com/go-chassis/go-archaius v1.3.3
+ github.com/go-chassis/go-chassis/v2 v2.0.2
+ github.com/go-chassis/openlog v1.1.1
github.com/go-chassis/paas-lager v1.1.1
- github.com/go-mesh/openlogging v1.0.1
+ github.com/go-chassis/seclog v1.2.1
github.com/go-playground/universal-translator v0.17.0
github.com/go-playground/validator v9.31.0+incompatible
github.com/hashicorp/serf v0.8.5
@@ -17,7 +18,7 @@ require (
github.com/xdg/stringprep v1.0.0 // indirect
go.mongodb.org/mongo-driver v1.3.0
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
- gopkg.in/yaml.v2 v2.2.4
+ gopkg.in/yaml.v2 v2.3.0
)
go 1.13
diff --git a/go.sum b/go.sum
index a19ce3e..a168453 100644
--- a/go.sum
+++ b/go.sum
@@ -74,6 +74,8 @@ github.com/fatih/color v1.7.0
h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod
h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7
h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod
h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9
h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
+github.com/fsnotify/fsnotify v1.4.9/go.mod
h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835/go.mod
h1:BjL/N0+C+j9uNX+1xcNuM9vdSIcXCZrQZUYbXOFbgN8=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod
h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod
h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -90,6 +92,8 @@ github.com/go-chassis/go-archaius
v1.2.2-0.20200409030209-a48668e4a025 h1:zzqQeC
github.com/go-chassis/go-archaius v1.2.2-0.20200409030209-a48668e4a025/go.mod
h1:gVP52u/jCU0fgUjXdUW1VLp5YLLJ+Yl2zoOPrLM/WOM=
github.com/go-chassis/go-archaius v1.3.2
h1:b52voYtSL+fukmvg/rsn/quw/hgDWtV945adl0VV8Lg=
github.com/go-chassis/go-archaius v1.3.2/go.mod
h1:nzRL1sSodtgeCZMzCNu0y2LPH5zz7chp8uaQ0GS0x6I=
+github.com/go-chassis/go-archaius v1.3.3
h1:phNCPOi5tIMj6SBLJCoD2GcE2f43rk0I3gdpHqm90Pg=
+github.com/go-chassis/go-archaius v1.3.3/go.mod
h1:K9gt8DIj582EQfKQdZV+jWBKNeevwaM+2cdLQgpOlZM=
github.com/go-chassis/go-chassis v0.0.0-20200318142212-4ca7f5fb7745
h1:BDHDeJBW+0/iC/1otn4XQ7ndfqzeGrFFi6SLSBuhRvs=
github.com/go-chassis/go-chassis v0.0.0-20200318142212-4ca7f5fb7745/go.mod
h1:UsROzOZPD9YgTpVUE/jFclVxDwHWESLNdwwbfKQ8aMs=
github.com/go-chassis/go-chassis v0.0.0-20200320074343-30f669c0c47b
h1:ZH88vLcGL4bNc+Vbm1g3jrhtTxBSnGvyZCpbbkVa5a0=
@@ -121,10 +125,16 @@ github.com/go-chassis/go-chassis
v1.8.2-0.20200331092516-8cf0b374128b/go.mod h1:
github.com/go-chassis/go-chassis v1.8.2-0.20200426111522-0f37ad3d79e5
h1:QpSTAsKX2S/H0lc7bPOrFGDlPLQGr86y+q4nt0r0lCg=
github.com/go-chassis/go-chassis v1.8.2-0.20200426111522-0f37ad3d79e5/go.mod
h1:ooQ3peVePtKic3ci/vIGEmGHTC5/BxUeYLN+eKu+EUU=
github.com/go-chassis/go-chassis v1.8.2
h1:lX+XJbIGSkC4c+1h8IcoBQFEX9vaZ0+KNugE24Q/I/Y=
+github.com/go-chassis/go-chassis/v2 v2.0.2
h1:FMiZgAa6IjDobtZN5oql+eSgMIlDq5+12ogrZRR62ks=
+github.com/go-chassis/go-chassis/v2 v2.0.2/go.mod
h1:xgXXrRUgn5sybtecTDn60ypepHKIV9QpSqR3CIEBNt0=
github.com/go-chassis/go-restful-swagger20
v1.0.3-0.20200310030431-17d80f34264f
h1:5QmmNpVcGqIc6tuKNe5EAI4PA8Yn2EL9Oee7YdcJ4PE=
github.com/go-chassis/go-restful-swagger20
v1.0.3-0.20200310030431-17d80f34264f/go.mod
h1:eW62fYuzlNFDvIacB6AV8bhUDCTy4myfTCv0bT9Gbb0=
+github.com/go-chassis/openlog v1.1.1
h1:iX7U0JP52SaJc5p7iOPVvpcbx3ML/53U1RuZDArW9xc=
+github.com/go-chassis/openlog v1.1.1/go.mod
h1:ZZOS68OvrFIKEJbuBa4YnYzmxyVx3lmcMfMKb+Hx/yQ=
github.com/go-chassis/paas-lager v1.1.1
h1:/6wqawUGjPCpd57A/tzJzgC4MnEhNuigbayQS+2VWPQ=
github.com/go-chassis/paas-lager v1.1.1/go.mod
h1:tILYbn3+0jjCxhY6/ue9L8eRq+VJ60U6VYIdugqchB4=
+github.com/go-chassis/seclog v1.2.1
h1:h+Aijmh76ICKD1jcajpt/LK2wJMmtHofUjE+/MhOrYs=
+github.com/go-chassis/seclog v1.2.1/go.mod
h1:88O2MV8uP6L3ulaIGcrwAtXhNAii/57cuvdDfW7JQIg=
github.com/go-kit/kit v0.8.0/go.mod
h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod
h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod
h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
@@ -182,6 +192,13 @@ github.com/golang/protobuf v1.2.0/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.3.1/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2
h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod
h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod
h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod
h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod
h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod
h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2
h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod
h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod
h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod
h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
@@ -191,6 +208,8 @@ github.com/google/btree v1.0.0/go.mod
h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0/go.mod
h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod
h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod
h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod
h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod
h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod
h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod
h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@@ -311,14 +330,19 @@ github.com/mwitkow/go-conntrack
v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod
h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/natefinch/lumberjack v0.0.0-20170531160350-a96e63847dc3
h1:BDvcX7oM8ZWOS08LQXaW8ucGblfoSG4srpoW6pKhvqs=
github.com/natefinch/lumberjack v0.0.0-20170531160350-a96e63847dc3/go.mod
h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk=
+github.com/nxadm/tail v1.4.4/go.mod
h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84/go.mod
h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod
h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod
h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo=
github.com/onsi/ginkgo v1.10.1/go.mod
h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.1/go.mod
h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.14.0/go.mod
h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod
h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod
h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/gomega v1.7.1/go.mod
h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod
h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/opentracing-contrib/go-observer
v0.0.0-20170622124052-a52f23424492/go.mod
h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
github.com/opentracing/opentracing-go v1.0.2
h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg=
github.com/opentracing/opentracing-go v1.0.2/go.mod
h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
@@ -456,6 +480,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod
h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod
h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod
h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod
h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod
h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod
h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod
h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -484,8 +510,14 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod
h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456
h1:ng0gs1AKnRRuEMZoTLLlbOd+C17zUDepwGQBb/n+JVg=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5
h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299
h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod
h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod
h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -510,6 +542,7 @@ golang.org/x/tools
v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgw
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c
h1:IGkKhmfzcztjm6gYkykvu/NiS8kaqbCWAEWWAyf8J5U=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod
h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.4.0/go.mod
h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/appengine v1.1.0/go.mod
h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod
h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -521,6 +554,13 @@ google.golang.org/genproto
v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2El
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod
h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod
h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod
h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod
h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod
h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod
h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod
h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0
h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod
h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod
h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod
h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
@@ -542,6 +582,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod
h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod
h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod
h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI=
diff --git a/server/handler/track_handler.go b/server/handler/track_handler.go
index d0f9118..bddd7a8 100644
--- a/server/handler/track_handler.go
+++ b/server/handler/track_handler.go
@@ -24,9 +24,9 @@ import (
"github.com/apache/servicecomb-kie/server/resource/v1"
"github.com/apache/servicecomb-kie/server/service"
"github.com/emicklei/go-restful"
- "github.com/go-chassis/go-chassis/core/handler"
- "github.com/go-chassis/go-chassis/core/invocation"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/core/handler"
+ "github.com/go-chassis/go-chassis/v2/core/invocation"
+ "github.com/go-chassis/openlog"
"net/http"
"strings"
)
@@ -81,7 +81,7 @@ func (h *TrackHandler) Handle(chain *handler.Chain, inv
*invocation.Invocation,
}
_, err := service.TrackService.CreateOrUpdate(inv.Ctx, data)
if err != nil {
- openlogging.Warn("record polling detail failed:" +
err.Error())
+ openlog.Warn("record polling detail failed:" +
err.Error())
cb(ir)
return
}
@@ -101,6 +101,6 @@ func (h *TrackHandler) Name() string {
}
func init() {
if err := handler.RegisterHandler(TrackHandlerName, newTrackHandler);
err != nil {
- openlogging.Fatal("register handler failed: " + err.Error())
+ openlog.Fatal("register handler failed: " + err.Error())
}
}
diff --git a/server/plugin/qms/quota.go b/server/plugin/qms/quota.go
index bd5c529..639b22a 100644
--- a/server/plugin/qms/quota.go
+++ b/server/plugin/qms/quota.go
@@ -21,8 +21,8 @@ import (
"context"
"github.com/apache/servicecomb-kie/server/service"
"github.com/go-chassis/go-archaius"
- "github.com/go-chassis/go-chassis/pkg/backends/quota"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/pkg/backends/quota"
+ "github.com/go-chassis/openlog"
)
//const
@@ -41,7 +41,7 @@ func (m *BuildInManager) GetQuotas(serviceName, domain
string) ([]*quota.Quota,
max := archaius.GetInt64(QuotaConfigKey, DefaultQuota)
total, err := service.KVService.Total(context.TODO(), domain)
if err != nil {
- openlogging.Error("find quotas failed: " + err.Error())
+ openlog.Error("find quotas failed: " + err.Error())
return nil, err
}
return []*quota.Quota{{
diff --git a/server/pubsub/bus.go b/server/pubsub/bus.go
index 7d5a7d0..a0f95c4 100644
--- a/server/pubsub/bus.go
+++ b/server/pubsub/bus.go
@@ -21,7 +21,7 @@ import (
"encoding/json"
"github.com/apache/servicecomb-kie/pkg/stringutil"
"github.com/apache/servicecomb-kie/server/config"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
"github.com/hashicorp/serf/cmd/serf/command/agent"
"github.com/hashicorp/serf/serf"
"sync"
@@ -60,7 +60,7 @@ func Init() {
ac.UserEventSizeLimit = 512
a, err := agent.Create(ac, sc, nil)
if err != nil {
- openlogging.Fatal("can not sync key value change events
to other kie nodes:" + err.Error())
+ openlog.Fatal("can not sync key value change events to
other kie nodes:" + err.Error())
}
bus = &Bus{
agent: a,
@@ -68,9 +68,9 @@ func Init() {
if config.Configurations.PeerAddr != "" {
err := join([]string{config.Configurations.PeerAddr})
if err != nil {
- openlogging.Fatal("lost event message")
+ openlog.Fatal("lost event message")
} else {
- openlogging.Info("join kie node:" +
config.Configurations.PeerAddr)
+ openlog.Info("join kie node:" +
config.Configurations.PeerAddr)
}
}
})
@@ -80,9 +80,9 @@ func Init() {
func Start() {
err := bus.agent.Start()
if err != nil {
- openlogging.Fatal("can not sync key value change events to
other kie nodes" + err.Error())
+ openlog.Fatal("can not sync key value change events to other
kie nodes" + err.Error())
}
- openlogging.Info("kie message bus started")
+ openlog.Info("kie message bus started")
bus.agent.RegisterEventHandler(&EventHandler{})
}
func join(addresses []string) error {
@@ -116,12 +116,12 @@ func ObserveOnce(o *Observer, topic *Topic) error {
topics.Store(t, map[string]*Observer{
o.UUID: o,
})
- openlogging.Info("new topic:" + t)
+ openlog.Info("new topic:" + t)
return nil
}
mutexObservers.Lock()
observers.(map[string]*Observer)[o.UUID] = o
mutexObservers.Unlock()
- openlogging.Debug("add new observer for topic:" + t)
+ openlog.Debug("add new observer for topic:" + t)
return nil
}
diff --git a/server/pubsub/event_handler.go b/server/pubsub/event_handler.go
index 7b6ebca..8b4f4e5 100644
--- a/server/pubsub/event_handler.go
+++ b/server/pubsub/event_handler.go
@@ -18,7 +18,7 @@
package pubsub
import (
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
"github.com/hashicorp/serf/serf"
"strings"
)
@@ -29,7 +29,7 @@ type EventHandler struct {
//HandleEvent send event to subscribers
func (h *EventHandler) HandleEvent(e serf.Event) {
- openlogging.Info("receive event:" + e.EventType().String())
+ openlog.Info("receive event:" + e.EventType().String())
switch e.EventType().String() {
case "user":
if strings.Contains(e.String(), EventKVChange) {
@@ -43,13 +43,13 @@ func handleKVEvent(e serf.Event) {
ue := e.(serf.UserEvent)
ke, err := NewKVChangeEvent(ue.Payload)
if err != nil {
- openlogging.Error("invalid json:" + string(ue.Payload))
+ openlog.Error("invalid json:" + string(ue.Payload))
}
- openlogging.Debug("kv event:" + ke.Key)
+ openlog.Debug("kv event:" + ke.Key)
topics.Range(func(key, value interface{}) bool { //range all topics
t, err := ParseTopicString(key.(string))
if err != nil {
- openlogging.Error("can not parse topic " + key.(string)
+ ": " + err.Error())
+ openlog.Error("can not parse topic " + key.(string) +
": " + err.Error())
return true
}
if t.Match(ke) {
diff --git a/server/rbac/rbac.go b/server/rbac/rbac.go
index f0e55a3..3c17f9c 100644
--- a/server/rbac/rbac.go
+++ b/server/rbac/rbac.go
@@ -21,10 +21,10 @@ import (
"github.com/apache/servicecomb-kie/server/config"
"github.com/apache/servicecomb-service-center/pkg/rbacframe"
"github.com/go-chassis/go-archaius"
- "github.com/go-chassis/go-chassis/middleware/jwt"
- "github.com/go-chassis/go-chassis/security/secret"
- "github.com/go-chassis/go-chassis/security/token"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/middleware/jwt"
+ "github.com/go-chassis/go-chassis/v2/security/secret"
+ "github.com/go-chassis/go-chassis/v2/security/token"
+ "github.com/go-chassis/openlog"
"io/ioutil"
"net/http"
"path/filepath"
@@ -38,7 +38,7 @@ const (
//Init initialize the rbac module
func Init() {
if !config.GetRBAC().Enabled {
- openlogging.Info("rbac is disabled")
+ openlog.Info("rbac is disabled")
return
}
@@ -56,7 +56,7 @@ func Init() {
SecretFunc: func(claims interface{}, method
token.SigningMethod) (interface{}, error) {
p, err := secret.ParseRSAPPublicKey(PublicKey())
if err != nil {
- openlogging.Error("can not parse public key:" +
err.Error())
+ openlog.Error("can not parse public key:" +
err.Error())
return nil, err
}
return p, nil
@@ -70,7 +70,7 @@ func Init() {
},
})
loadPublicKey()
- openlogging.Info("rbac is enabled")
+ openlog.Info("rbac is enabled")
}
//loadPublicKey read key to memory
@@ -78,12 +78,12 @@ func loadPublicKey() {
pf := config.GetRBAC().PubKeyFile
content, err := ioutil.ReadFile(filepath.Clean(pf))
if err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
return
}
err = archaius.Set(pubContentKey, string(content))
if err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
}
diff --git a/server/resource/v1/admin_resource.go
b/server/resource/v1/admin_resource.go
index f3b0624..5b4c191 100644
--- a/server/resource/v1/admin_resource.go
+++ b/server/resource/v1/admin_resource.go
@@ -21,9 +21,9 @@ import (
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/service"
goRestful "github.com/emicklei/go-restful"
- "github.com/go-chassis/go-chassis/pkg/runtime"
- "github.com/go-chassis/go-chassis/server/restful"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/pkg/runtime"
+ "github.com/go-chassis/go-chassis/v2/server/restful"
+ "github.com/go-chassis/openlog"
"net/http"
"strconv"
"time"
@@ -73,6 +73,6 @@ func (r *AdminResource) HealthCheck(context *restful.Context)
{
resp.Total = total
err = writeResponse(context, resp)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
diff --git a/server/resource/v1/admin_resource_test.go
b/server/resource/v1/admin_resource_test.go
index b1eb7a4..b132aed 100644
--- a/server/resource/v1/admin_resource_test.go
+++ b/server/resource/v1/admin_resource_test.go
@@ -22,7 +22,7 @@ import (
"fmt"
"github.com/apache/servicecomb-kie/pkg/model"
v1 "github.com/apache/servicecomb-kie/server/resource/v1"
- "github.com/go-chassis/go-chassis/server/restful/restfultest"
+ "github.com/go-chassis/go-chassis/v2/server/restful/restfultest"
"github.com/stretchr/testify/assert"
"io/ioutil"
"net/http"
diff --git a/server/resource/v1/common.go b/server/resource/v1/common.go
index 51ae38a..21b80c1 100644
--- a/server/resource/v1/common.go
+++ b/server/resource/v1/common.go
@@ -33,8 +33,8 @@ import (
"github.com/apache/servicecomb-kie/server/pubsub"
"github.com/apache/servicecomb-kie/server/service"
goRestful "github.com/emicklei/go-restful"
- "github.com/go-chassis/go-chassis/server/restful"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/server/restful"
+ "github.com/go-chassis/openlog"
uuid "github.com/satori/go.uuid"
"gopkg.in/yaml.v2"
)
@@ -104,12 +104,12 @@ func WriteErrResponse(context *restful.Context, status
int, msg string) {
context.WriteHeader(status)
b, err := json.MarshalIndent(&ErrorMsg{Msg: msg}, "", " ")
if err != nil {
- openlogging.Error("can not marshal:" + err.Error())
+ openlog.Error("can not marshal:" + err.Error())
return
}
err = context.Write(b)
if err != nil {
- openlogging.Error("can not marshal:" + err.Error())
+ openlog.Error("can not marshal:" + err.Error())
}
}
@@ -265,7 +265,7 @@ func queryAndResponse(rctx *restful.Context, request
*model.ListKVRequest) {
}
kv, err := service.KVService.List(rctx.Ctx, request.Domain,
request.Project, opts...)
if err != nil {
- openlogging.Error("common: " + err.Error())
+ openlog.Error("common: " + err.Error())
WriteErrResponse(rctx, http.StatusInternalServerError,
common.MsgDBError)
return
}
@@ -273,6 +273,6 @@ func queryAndResponse(rctx *restful.Context, request
*model.ListKVRequest) {
err = writeResponse(rctx, kv)
rctx.ReadRestfulRequest().SetAttribute(common.RespBodyContextKey,
kv.Data)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
diff --git a/server/resource/v1/doc_struct.go b/server/resource/v1/doc_struct.go
index c4aef61..045d06d 100644
--- a/server/resource/v1/doc_struct.go
+++ b/server/resource/v1/doc_struct.go
@@ -21,7 +21,7 @@ import (
"github.com/apache/servicecomb-kie/pkg/common"
goRestful "github.com/emicklei/go-restful"
- "github.com/go-chassis/go-chassis/server/restful"
+ "github.com/go-chassis/go-chassis/v2/server/restful"
)
//swagger doc request header params
diff --git a/server/resource/v1/history_resource.go
b/server/resource/v1/history_resource.go
index e3616ee..ed80d97 100644
--- a/server/resource/v1/history_resource.go
+++ b/server/resource/v1/history_resource.go
@@ -24,8 +24,8 @@ import (
"net/http"
goRestful "github.com/emicklei/go-restful"
- "github.com/go-chassis/go-chassis/server/restful"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/server/restful"
+ "github.com/go-chassis/openlog"
)
//HistoryResource TODO
@@ -44,7 +44,7 @@ func (r *HistoryResource) GetRevisions(context
*restful.Context) {
return
}
if kvID == "" {
- openlogging.Error("kv id is nil")
+ openlog.Error("kv id is nil")
WriteErrResponse(context, http.StatusForbidden, "kv_id must not
be empty")
return
}
@@ -61,7 +61,7 @@ func (r *HistoryResource) GetRevisions(context
*restful.Context) {
}
err = writeResponse(context, revisions)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
@@ -104,7 +104,7 @@ func (r *HistoryResource) GetPollingData(context
*restful.Context) {
resp.Total = len(records)
err = writeResponse(context, resp)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
diff --git a/server/resource/v1/history_resource_test.go
b/server/resource/v1/history_resource_test.go
index 00a1ab2..ce8a863 100644
--- a/server/resource/v1/history_resource_test.go
+++ b/server/resource/v1/history_resource_test.go
@@ -30,9 +30,9 @@ import (
handler2 "github.com/apache/servicecomb-kie/server/handler"
v1 "github.com/apache/servicecomb-kie/server/resource/v1"
"github.com/apache/servicecomb-kie/server/service"
- "github.com/go-chassis/go-chassis/core/common"
- "github.com/go-chassis/go-chassis/core/handler"
- "github.com/go-chassis/go-chassis/server/restful/restfultest"
+ "github.com/go-chassis/go-chassis/v2/core/common"
+ "github.com/go-chassis/go-chassis/v2/core/handler"
+ "github.com/go-chassis/go-chassis/v2/server/restful/restfultest"
"github.com/stretchr/testify/assert"
_ "github.com/apache/servicecomb-kie/server/service/mongo"
diff --git a/server/resource/v1/kv_resource.go
b/server/resource/v1/kv_resource.go
index d11b348..b228e3a 100644
--- a/server/resource/v1/kv_resource.go
+++ b/server/resource/v1/kv_resource.go
@@ -31,9 +31,9 @@ import (
"github.com/apache/servicecomb-kie/server/service/mongo/session"
goRestful "github.com/emicklei/go-restful"
- "github.com/go-chassis/go-chassis/pkg/backends/quota"
- "github.com/go-chassis/go-chassis/server/restful"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/pkg/backends/quota"
+ "github.com/go-chassis/go-chassis/v2/server/restful"
+ "github.com/go-chassis/openlog"
)
//KVResource has API about kv operations
@@ -63,17 +63,17 @@ func (r *KVResource) Post(rctx *restful.Context) {
err = quota.PreCreate("", kv.Domain, "", 1)
if err != nil {
if err == quota.ErrReached {
- openlogging.Info(fmt.Sprintf("can not create kv %s@%s,
due to quota violation", kv.Key, kv.Project))
+ openlog.Info(fmt.Sprintf("can not create kv %s@%s, due
to quota violation", kv.Key, kv.Project))
WriteErrResponse(rctx, http.StatusUnprocessableEntity,
err.Error())
return
}
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
WriteErrResponse(rctx, http.StatusInternalServerError, "quota
check failed")
return
}
kv, err = service.KVService.Create(rctx.Ctx, kv)
if err != nil {
- openlogging.Error(fmt.Sprintf("post err:%s", err.Error()))
+ openlog.Error(fmt.Sprintf("post err:%s", err.Error()))
if err == session.ErrKVAlreadyExists {
WriteErrResponse(rctx, http.StatusConflict, err.Error())
return
@@ -89,13 +89,13 @@ func (r *KVResource) Post(rctx *restful.Context) {
Action: pubsub.ActionPut,
})
if err != nil {
- openlogging.Warn("lost kv change event when post:" +
err.Error())
+ openlog.Warn("lost kv change event when post:" + err.Error())
}
- openlogging.Info(
+ openlog.Info(
fmt.Sprintf("post [%s] success", kv.ID))
err = writeResponse(rctx, kv)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
@@ -121,7 +121,7 @@ func (r *KVResource) Put(rctx *restful.Context) {
}
kv, err := service.KVService.Update(rctx.Ctx, kvReq)
if err != nil {
- openlogging.Error(fmt.Sprintf("put [%s] err:%s", kvID,
err.Error()))
+ openlog.Error(fmt.Sprintf("put [%s] err:%s", kvID, err.Error()))
WriteErrResponse(rctx, http.StatusInternalServerError, "update
kv failed")
return
}
@@ -133,13 +133,13 @@ func (r *KVResource) Put(rctx *restful.Context) {
Action: pubsub.ActionPut,
})
if err != nil {
- openlogging.Warn("lost kv change event when put:" + err.Error())
+ openlog.Warn("lost kv change event when put:" + err.Error())
}
- openlogging.Info(
+ openlog.Info(
fmt.Sprintf("put [%s] success", kvID))
err = writeResponse(rctx, kv)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
@@ -158,7 +158,7 @@ func (r *KVResource) Get(rctx *restful.Context) {
}
kv, err := service.KVService.Get(rctx.Ctx, request)
if err != nil {
- openlogging.Error("kv_resource: " + err.Error())
+ openlog.Error("kv_resource: " + err.Error())
if err == service.ErrKeyNotExists {
WriteErrResponse(rctx, http.StatusNotFound, err.Error())
return
@@ -170,7 +170,7 @@ func (r *KVResource) Get(rctx *restful.Context) {
kv.Project = ""
err = writeResponse(rctx, kv)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
}
@@ -277,7 +277,7 @@ func (r *KVResource) Delete(rctx *restful.Context) {
}
kv, err := service.KVService.FindOneAndDelete(rctx.Ctx, kvID, domain,
project)
if err != nil {
- openlogging.Error("delete failed, ",
openlogging.WithTags(openlogging.Tags{
+ openlog.Error("delete failed, ", openlog.WithTags(openlog.Tags{
"kvID": kvID,
"error": err.Error(),
}))
@@ -296,7 +296,7 @@ func (r *KVResource) Delete(rctx *restful.Context) {
Action: pubsub.ActionDelete,
})
if err != nil {
- openlogging.Warn("lost kv change event:" + err.Error())
+ openlog.Warn("lost kv change event:" + err.Error())
}
rctx.WriteHeader(http.StatusNoContent)
}
@@ -321,7 +321,7 @@ func (r *KVResource) DeleteList(rctx *restful.Context) {
rctx.WriteHeader(http.StatusNoContent)
return
}
- openlogging.Error("delete list failed, ",
openlogging.WithTags(openlogging.Tags{
+ openlog.Error("delete list failed, ",
openlog.WithTags(openlog.Tags{
"kvIDs": b.IDs,
"error": err.Error(),
}))
@@ -337,7 +337,7 @@ func (r *KVResource) DeleteList(rctx *restful.Context) {
Action: pubsub.ActionDelete,
})
if err != nil {
- openlogging.Warn("lost kv change event:" + err.Error())
+ openlog.Warn("lost kv change event:" + err.Error())
}
}
rctx.WriteHeader(http.StatusNoContent)
diff --git a/server/resource/v1/kv_resource_test.go
b/server/resource/v1/kv_resource_test.go
index e05be71..6a07d27 100644
--- a/server/resource/v1/kv_resource_test.go
+++ b/server/resource/v1/kv_resource_test.go
@@ -29,10 +29,10 @@ import (
v1 "github.com/apache/servicecomb-kie/server/resource/v1"
"github.com/apache/servicecomb-kie/server/service"
"github.com/go-chassis/go-archaius"
- "github.com/go-chassis/go-chassis/pkg/backends/quota"
- "github.com/go-chassis/go-chassis/server/restful/restfultest"
- log "github.com/go-chassis/paas-lager"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2/pkg/backends/quota"
+ "github.com/go-chassis/go-chassis/v2/server/restful/restfultest"
+ "github.com/go-chassis/openlog"
+ log "github.com/go-chassis/seclog"
"github.com/stretchr/testify/assert"
"io/ioutil"
"net/http"
@@ -55,7 +55,7 @@ func init() {
LogFormatText: false,
})
logger := log.NewLogger("ut")
- openlogging.SetLogger(logger)
+ openlog.SetLogger(logger)
//for UT
config.Configurations = &config.Config{
DB: config.DB{},
diff --git a/server/server.go b/server/server.go
index 516030e..3f57559 100644
--- a/server/server.go
+++ b/server/server.go
@@ -24,9 +24,9 @@ import (
"github.com/apache/servicecomb-kie/server/rbac"
v1 "github.com/apache/servicecomb-kie/server/resource/v1"
"github.com/apache/servicecomb-kie/server/service"
- "github.com/go-chassis/go-chassis"
- "github.com/go-chassis/go-chassis/core/common"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/go-chassis/v2"
+ "github.com/go-chassis/go-chassis/v2/core/common"
+ "github.com/go-chassis/openlog"
)
func Run() {
@@ -34,21 +34,21 @@ func Run() {
chassis.RegisterSchema(common.ProtocolRest, &v1.HistoryResource{})
chassis.RegisterSchema(common.ProtocolRest, &v1.AdminResource{})
if err := chassis.Init(); err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
if err := config.Init(); err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
if err := service.DBInit(); err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
if err := validate.Init(); err != nil {
- openlogging.Fatal("validate init failed: " + err.Error())
+ openlog.Fatal("validate init failed: " + err.Error())
}
rbac.Init()
pubsub.Init()
pubsub.Start()
if err := chassis.Run(); err != nil {
- openlogging.Fatal("service exit: " + err.Error())
+ openlog.Fatal("service exit: " + err.Error())
}
}
diff --git a/server/service/mongo/counter/revision.go
b/server/service/mongo/counter/revision.go
index 5da19c0..67fffc6 100644
--- a/server/service/mongo/counter/revision.go
+++ b/server/service/mongo/counter/revision.go
@@ -22,7 +22,7 @@ import (
"errors"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo/options"
)
@@ -41,7 +41,7 @@ func (s *Service) GetRevision(ctx context.Context, domain
string) (int64, error)
if err != nil {
if err.Error() == context.DeadlineExceeded.Error() {
msg := "operation timeout"
- openlogging.Error(msg)
+ openlog.Error(msg)
return 0, errors.New(msg)
}
return 0, err
@@ -50,7 +50,7 @@ func (s *Service) GetRevision(ctx context.Context, domain
string) (int64, error)
c := &Counter{}
for cur.Next(ctx) {
if err := cur.Decode(c); err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return 0, err
}
}
@@ -72,7 +72,7 @@ func ApplyRevision(ctx context.Context, domain string)
(int64, error) {
c := &Counter{}
err := sr.Decode(c)
if err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return 0, err
}
return c.Count, nil
diff --git a/server/service/mongo/history/dao.go
b/server/service/mongo/history/dao.go
index b769f09..a215d08 100644
--- a/server/service/mongo/history/dao.go
+++ b/server/service/mongo/history/dao.go
@@ -25,7 +25,7 @@ import (
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/service"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo/options"
)
@@ -58,7 +58,7 @@ func getHistoryByKeyID(ctx context.Context, filter bson.M,
offset, limit int64)
var elem model.KVDoc
err := cur.Decode(&elem)
if err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return nil, err
}
exist = true
@@ -83,12 +83,12 @@ func AddHistory(ctx context.Context, kv *model.KVDoc) error
{
collection := session.GetDB().Collection(session.CollectionKVRevision)
_, err := collection.InsertOne(ctx, kv)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return err
}
err = historyRotate(ctx, kv.ID, kv.Project, kv.Domain)
if err != nil {
- openlogging.Error("history rotate err: " + err.Error())
+ openlog.Error("history rotate err: " + err.Error())
return err
}
return nil
@@ -108,7 +108,7 @@ func AddDeleteTime(ctx context.Context, kvIDs []string,
project, domain string)
if err != nil {
return err
}
- openlogging.Debug(fmt.Sprintf("added delete time [%s] to kvs [%v]",
now.String(), kvIDs))
+ openlog.Debug(fmt.Sprintf("added delete time [%s] to kvs [%v]",
now.String(), kvIDs))
return nil
}
@@ -140,7 +140,7 @@ func historyRotate(ctx context.Context, kvID, project,
domain string) error {
for cur.Next(ctx) {
curKV := &model.KVDoc{}
if err := cur.Decode(curKV); err != nil {
- openlogging.Error("decode to KVs error: " + err.Error())
+ openlog.Error("decode to KVs error: " + err.Error())
return err
}
_, err := collection.DeleteOne(ctx, bson.M{
@@ -152,7 +152,7 @@ func historyRotate(ctx context.Context, kvID, project,
domain string) error {
if err != nil {
return err
}
- openlogging.Debug("delete overflowed revision",
openlogging.WithTags(openlogging.Tags{
+ openlog.Debug("delete overflowed revision",
openlog.WithTags(openlog.Tags{
"id": curKV.ID,
"key": curKV.Key,
"revision": curKV.UpdateRevision,
diff --git a/server/service/mongo/init.go b/server/service/mongo/init.go
index 14d1155..e53d55a 100644
--- a/server/service/mongo/init.go
+++ b/server/service/mongo/init.go
@@ -24,11 +24,11 @@ import (
"github.com/apache/servicecomb-kie/server/service/mongo/kv"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
"github.com/apache/servicecomb-kie/server/service/mongo/track"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
)
func init() {
- openlogging.Info("use mongodb as storage")
+ openlog.Info("use mongodb as storage")
service.DBInit = session.Init
service.KVService = &kv.Service{}
service.HistoryService = &history.Service{}
diff --git a/server/service/mongo/kv/kv_dao.go
b/server/service/mongo/kv/kv_dao.go
index 1c4f90f..10e750c 100644
--- a/server/service/mongo/kv/kv_dao.go
+++ b/server/service/mongo/kv/kv_dao.go
@@ -27,7 +27,7 @@ import (
"github.com/apache/servicecomb-kie/server/service/mongo/counter"
"github.com/apache/servicecomb-kie/server/service/mongo/history"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
uuid "github.com/satori/go.uuid"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
@@ -43,7 +43,7 @@ func createKey(ctx context.Context, kv *model.KVDoc)
(*model.KVDoc, error) {
kv.ID = uuid.NewV4().String()
revision, err := counter.ApplyRevision(ctx, kv.Domain)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return nil, err
}
kv.UpdateRevision = revision
@@ -53,7 +53,7 @@ func createKey(ctx context.Context, kv *model.KVDoc)
(*model.KVDoc, error) {
kv.UpdateTime = now
_, err = collection.InsertOne(ctx, kv)
if err != nil {
- openlogging.Error("create error",
openlogging.WithTags(openlogging.Tags{
+ openlog.Error("create error", openlog.WithTags(openlog.Tags{
"err": err.Error(),
"kv": kv,
}))
@@ -61,11 +61,11 @@ func createKey(ctx context.Context, kv *model.KVDoc)
(*model.KVDoc, error) {
}
err = history.AddHistory(ctx, kv)
if err != nil {
- openlogging.Warn(
+ openlog.Warn(
fmt.Sprintf("can not updateKeyValue version for [%s]
[%s] in [%s]",
kv.Key, kv.Labels, kv.Domain))
}
- openlogging.Debug(fmt.Sprintf("create %s with labels %s value [%s]",
kv.Key, kv.Labels, kv.Value))
+ openlog.Debug(fmt.Sprintf("create %s with labels %s value [%s]",
kv.Key, kv.Labels, kv.Value))
return kv, nil
@@ -92,16 +92,16 @@ func updateKeyValue(ctx context.Context, kv *model.KVDoc)
error {
if err != nil {
return err
}
- openlogging.Debug(
+ openlog.Debug(
fmt.Sprintf("updateKeyValue %s with labels %s value [%s] %d ",
kv.Key, kv.Labels, kv.Value, ur.ModifiedCount))
err = history.AddHistory(ctx, kv)
if err != nil {
- openlogging.Error(
+ openlog.Error(
fmt.Sprintf("can not add revision for [%s] [%s] in
[%s],err: %s",
kv.Key, kv.Labels, kv.Domain, err))
}
- openlogging.Debug(
+ openlog.Debug(
fmt.Sprintf("add history %s with labels %s value [%s] %d ",
kv.Key, kv.Labels, kv.Value, ur.ModifiedCount))
return nil
@@ -128,7 +128,7 @@ func findKV(ctx context.Context, domain string, project
string, opts service.Fin
curTotal, err := collection.CountDocuments(ctx, filter)
if err != nil {
if err.Error() == context.DeadlineExceeded.Error() {
- openlogging.Error(MsgFindKvFailed,
openlogging.WithTags(openlogging.Tags{
+ openlog.Error(MsgFindKvFailed,
openlog.WithTags(openlog.Tags{
"timeout": opts.Timeout,
}))
return nil, 0, fmt.Errorf(FmtErrFindKvFailed,
opts.Timeout)
@@ -141,7 +141,7 @@ func findKV(ctx context.Context, domain string, project
string, opts service.Fin
cur, err := collection.Find(ctx, filter, opt)
if err != nil {
if err.Error() == context.DeadlineExceeded.Error() {
- openlogging.Error(MsgFindKvFailed,
openlogging.WithTags(openlogging.Tags{
+ openlog.Error(MsgFindKvFailed,
openlog.WithTags(openlog.Tags{
"timeout": opts.Timeout,
}))
return nil, 0, fmt.Errorf(FmtErrFindKvFailed,
opts.Timeout)
@@ -162,7 +162,7 @@ func findOneKey(ctx context.Context, filter bson.M)
([]*model.KVDoc, error) {
curKV := &model.KVDoc{}
err := sr.Decode(curKV)
if err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return nil, err
}
return []*model.KVDoc{curKV}, nil
@@ -178,19 +178,19 @@ func findOneKVAndDelete(ctx context.Context, kvID,
project, domain string) (*mod
}
return nil, sr.Err()
}
- openlogging.Info(fmt.Sprintf("delete success,kvID=%s", kvID))
+ openlog.Info(fmt.Sprintf("delete success,kvID=%s", kvID))
if _, err := counter.ApplyRevision(ctx, domain); err != nil {
- openlogging.Error(fmt.Sprintf("the kv [%s] is deleted, but
increase revision failed: [%s]", kvID, err))
+ openlog.Error(fmt.Sprintf("the kv [%s] is deleted, but increase
revision failed: [%s]", kvID, err))
return nil, err
}
err := history.AddDeleteTime(ctx, []string{kvID}, project, domain)
if err != nil {
- openlogging.Error(fmt.Sprintf("add delete time to [%s] failed :
[%s]", kvID, err))
+ openlog.Error(fmt.Sprintf("add delete time to [%s] failed :
[%s]", kvID, err))
}
curKV := &model.KVDoc{}
err = sr.Decode(curKV)
if err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return nil, err
}
return curKV, nil
@@ -202,28 +202,28 @@ func findKVsAndDelete(ctx context.Context, kvIDs
[]string, project, domain strin
kvs, err := findKeys(ctx, filter, false)
if err != nil {
if err != service.ErrKeyNotExists {
- openlogging.Error("find Keys error: " + err.Error())
+ openlog.Error("find Keys error: " + err.Error())
}
return nil, err
}
collection := session.GetDB().Collection(session.CollectionKV)
dr, err := collection.DeleteMany(ctx, filter)
if err != nil {
- openlogging.Error(fmt.Sprintf("delete kvs [%v] failed : [%v]",
kvIDs, err))
+ openlog.Error(fmt.Sprintf("delete kvs [%v] failed : [%v]",
kvIDs, err))
return nil, err
}
if int64(len(kvs)) != dr.DeletedCount {
- openlogging.Warn(fmt.Sprintf("The count of found and the count
of deleted are not equal, found %d, deleted %d", len(kvs), dr.DeletedCount))
+ openlog.Warn(fmt.Sprintf("The count of found and the count of
deleted are not equal, found %d, deleted %d", len(kvs), dr.DeletedCount))
} else {
- openlogging.Info(fmt.Sprintf("deleted %d kvs, their ids are
%v", dr.DeletedCount, kvIDs))
+ openlog.Info(fmt.Sprintf("deleted %d kvs, their ids are %v",
dr.DeletedCount, kvIDs))
}
if _, err := counter.ApplyRevision(ctx, domain); err != nil {
- openlogging.Error(fmt.Sprintf("kvs [%v] are deleted, but
increase revision failed: [%v]", kvIDs, err))
+ openlog.Error(fmt.Sprintf("kvs [%v] are deleted, but increase
revision failed: [%v]", kvIDs, err))
return nil, err
}
err = history.AddDeleteTime(ctx, kvIDs, project, domain)
if err != nil {
- openlogging.Error(fmt.Sprintf("add delete time to kvs [%s]
failed : [%s]", kvIDs, err))
+ openlog.Error(fmt.Sprintf("add delete time to kvs [%s] failed :
[%s]", kvIDs, err))
}
return kvs, nil
}
@@ -233,7 +233,7 @@ func findKeys(ctx context.Context, filter interface{},
withoutLabel bool) ([]*mo
cur, err := collection.Find(ctx, filter)
if err != nil {
if err.Error() == context.DeadlineExceeded.Error() {
- openlogging.Error("find kvs failed, dead line
exceeded", openlogging.WithTags(openlogging.Tags{
+ openlog.Error("find kvs failed, dead line exceeded",
openlog.WithTags(openlog.Tags{
"timeout": session.Timeout,
}))
return nil, fmt.Errorf("can not find keys due to
timout")
@@ -248,7 +248,7 @@ func findKeys(ctx context.Context, filter interface{},
withoutLabel bool) ([]*mo
for cur.Next(ctx) {
curKV := &model.KVDoc{}
if err := cur.Decode(curKV); err != nil {
- openlogging.Error("decode to KVs error: " + err.Error())
+ openlog.Error("decode to KVs error: " + err.Error())
return nil, err
}
if withoutLabel {
@@ -281,7 +281,7 @@ func findKVDocByID(ctx context.Context, domain, project,
kvID string) (*model.KV
filter := bson.M{"id": kvID, "domain": domain, "project": project}
kvs, err := findOneKey(ctx, filter)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return nil, err
}
return kvs[0], nil
@@ -292,7 +292,7 @@ func total(ctx context.Context, domain string) (int64,
error) {
filter := bson.M{"domain": domain}
total, err := collection.CountDocuments(ctx, filter)
if err != nil {
- openlogging.Error("find total number: " + err.Error())
+ openlog.Error("find total number: " + err.Error())
return 0, err
}
return total, err
diff --git a/server/service/mongo/kv/kv_service.go
b/server/service/mongo/kv/kv_service.go
index 3a11214..c1d0cae 100644
--- a/server/service/mongo/kv/kv_service.go
+++ b/server/service/mongo/kv/kv_service.go
@@ -26,7 +26,7 @@ import (
"github.com/apache/servicecomb-kie/pkg/util"
"github.com/apache/servicecomb-kie/server/service"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
)
//const of kv service
@@ -58,12 +58,12 @@ func (s *Service) Create(ctx context.Context, kv
*model.KVDoc) (*model.KVDoc, er
return nil, session.ErrKVAlreadyExists
}
if err != service.ErrKeyNotExists {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return nil, err
}
kv, err = createKey(ctx, kv)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return nil, err
}
clearPart(kv)
@@ -108,7 +108,7 @@ func (s *Service) Exist(ctx context.Context, domain, key
string, project string,
kvs, err := findKVByLabel(ctx, domain, opts.LabelFormat, key,
project)
if err != nil {
if err != service.ErrKeyNotExists {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
}
return nil, err
}
@@ -119,7 +119,7 @@ func (s *Service) Exist(ctx context.Context, domain, key
string, project string,
service.WithLabels(opts.Labels),
service.WithKey(key))
if err != nil {
- openlogging.Error("check kv exist: " + err.Error())
+ openlog.Error("check kv exist: " + err.Error())
return nil, err
}
if len(kvs.Data) != 1 {
@@ -160,7 +160,7 @@ func (s *Service) List(ctx context.Context, domain, project
string, options ...s
for cur.Next(ctx) {
curKV := &model.KVDoc{}
if err := cur.Decode(curKV); err != nil {
- openlogging.Error("decode to KVs error: " + err.Error())
+ openlog.Error("decode to KVs error: " + err.Error())
return nil, err
}
if opts.ExactLabels {
diff --git a/server/service/mongo/kv/kv_service_test.go
b/server/service/mongo/kv/kv_service_test.go
index 4e30185..12b2c10 100644
--- a/server/service/mongo/kv/kv_service_test.go
+++ b/server/service/mongo/kv/kv_service_test.go
@@ -25,8 +25,8 @@ import (
"github.com/apache/servicecomb-kie/server/service"
"github.com/apache/servicecomb-kie/server/service/mongo/kv"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- log "github.com/go-chassis/paas-lager"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
+ log "github.com/go-chassis/seclog"
"github.com/stretchr/testify/assert"
"testing"
)
@@ -40,7 +40,7 @@ func init() {
})
logger := log.NewLogger("ut")
- openlogging.SetLogger(logger)
+ openlog.SetLogger(logger)
}
func TestService_CreateOrUpdate(t *testing.T) {
diff --git a/server/service/mongo/session/session.go
b/server/service/mongo/session/session.go
index 37193ec..fa1fee6 100644
--- a/server/service/mongo/session/session.go
+++ b/server/service/mongo/session/session.go
@@ -25,7 +25,7 @@ import (
"errors"
"fmt"
"github.com/apache/servicecomb-kie/pkg/model"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/bsoncodec"
"go.mongodb.org/mongo-driver/mongo/options"
@@ -124,19 +124,19 @@ func Init() error {
InsecureSkipVerify: !config.GetDB().VerifyPeer,
}
clientOps = append(clientOps,
options.Client().SetTLSConfig(tc))
- openlogging.Info("enabled ssl communication to mongodb")
+ openlog.Info("enabled ssl communication to mongodb")
}
client, err = mongo.NewClient(clientOps...)
if err != nil {
return
}
- openlogging.Info("DB connecting")
+ openlog.Info("DB connecting")
ctx, _ := context.WithTimeout(context.Background(),
10*time.Second)
err = client.Connect(ctx)
if err != nil {
return
}
- openlogging.Info("DB connected")
+ openlog.Info("DB connected")
db = client.Database(DBName, &options.DatabaseOptions{
Registry: reg,
})
@@ -160,7 +160,7 @@ func CreateView(ctx context.Context, view, source string,
pipeline mongo.Pipelin
{"pipeline", pipeline},
})
if sr.Err() != nil {
- openlogging.Error("can not create view: " + sr.Err().Error())
+ openlog.Error("can not create view: " + sr.Err().Error())
return ErrViewCreation
}
return nil
@@ -170,7 +170,7 @@ func CreateView(ctx context.Context, view, source string,
pipeline mongo.Pipelin
func DropView(ctx context.Context, view string) error {
err := GetDB().Collection(view).Drop(ctx)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return err
}
return nil
@@ -180,16 +180,16 @@ func DropView(ctx context.Context, view string) error {
func GetColInfo(ctx context.Context, name string) (*CollectionInfo, error) {
cur, err := GetDB().ListCollections(ctx, bson.M{"name": name, "type":
"view"})
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return nil, ErrGetPipeline
}
defer cur.Close(ctx)
for cur.Next(ctx) {
- openlogging.Debug(cur.Current.String())
+ openlog.Debug(cur.Current.String())
c := &CollectionInfo{}
err := cur.Decode(c)
if err != nil {
- openlogging.Error(err.Error())
+ openlog.Error(err.Error())
return nil, ErrGetPipeline
}
return c, nil
@@ -202,7 +202,7 @@ func GetColInfo(ctx context.Context, name string)
(*CollectionInfo, error) {
func EnsureDB() {
session, err := mgo.Dial(config.GetDB().URI)
if err != nil {
- openlogging.Fatal("can not dial db:" + err.Error())
+ openlog.Fatal("can not dial db:" + err.Error())
}
defer session.Close()
session.SetMode(mgo.Monotonic, true)
@@ -297,9 +297,9 @@ func ensureRevisionCounter(session *mgo.Session) {
}})
if err != nil {
if strings.Contains(err.Error(), MsgExists) {
- openlogging.Debug(err.Error())
+ openlog.Debug(err.Error())
} else {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
}
err = c.EnsureIndex(mgo.Index{
@@ -307,15 +307,15 @@ func ensureRevisionCounter(session *mgo.Session) {
Unique: true,
})
if err != nil {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
docs := map[string]interface{}{"name": "revision_counter", "count": 1,
"domain": "default"}
err = c.Insert(docs)
if err != nil {
if strings.Contains(err.Error(), MsgDuplicate) {
- openlogging.Debug(err.Error())
+ openlog.Debug(err.Error())
} else {
- openlogging.Fatal(err.Error())
+ openlog.Fatal(err.Error())
}
}
}
diff --git a/server/service/mongo/track/polling_detail_dao.go
b/server/service/mongo/track/polling_detail_dao.go
index 9514043..bb3bcae 100644
--- a/server/service/mongo/track/polling_detail_dao.go
+++ b/server/service/mongo/track/polling_detail_dao.go
@@ -22,7 +22,7 @@ import (
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/service"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
uuid "github.com/satori/go.uuid"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
@@ -79,7 +79,7 @@ func Get(ctx context.Context, detail *model.PollingDetail)
([]*model.PollingDeta
for cur.Next(ctx) {
curRecord := &model.PollingDetail{}
if err := cur.Decode(curRecord); err != nil {
- openlogging.Error("decode to KVs error: " + err.Error())
+ openlog.Error("decode to KVs error: " + err.Error())
return nil, err
}
curRecord.Domain = ""
diff --git a/server/service/mongo/view/view_dao.go
b/server/service/mongo/view/view_dao.go
index 90d4314..ac11ae7 100644
--- a/server/service/mongo/view/view_dao.go
+++ b/server/service/mongo/view/view_dao.go
@@ -21,7 +21,7 @@ import (
"context"
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
uuid "github.com/satori/go.uuid"
"go.mongodb.org/mongo-driver/bson"
)
@@ -31,7 +31,7 @@ func create(ctx context.Context, viewDoc *model.ViewDoc)
error {
viewDoc.Criteria = "" //TODO parse pipe line to sql-like lang
_, err :=
session.GetDB().Collection(session.CollectionView).InsertOne(ctx, viewDoc)
if err != nil {
- openlogging.Error("can not insert view collection: " +
err.Error())
+ openlog.Error("can not insert view collection: " + err.Error())
return session.ErrViewCreation
}
return nil
@@ -42,13 +42,13 @@ func findOne(ctx context.Context, viewID, domain, project
string) (*model.ViewDo
"id": viewID}
sr := session.GetDB().Collection(session.CollectionView).FindOne(ctx,
filter)
if sr.Err() != nil {
- openlogging.Error("can not insert view collection: " +
sr.Err().Error())
+ openlog.Error("can not find view collection: " +
sr.Err().Error())
return nil, sr.Err()
}
result := &model.ViewDoc{}
err := sr.Decode(result)
if err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return nil, err
}
if result.ID == viewID {
diff --git a/server/service/mongo/view/view_service.go
b/server/service/mongo/view/view_service.go
index 9126e73..4c40350 100644
--- a/server/service/mongo/view/view_service.go
+++ b/server/service/mongo/view/view_service.go
@@ -22,7 +22,7 @@ import (
"github.com/apache/servicecomb-kie/pkg/model"
"github.com/apache/servicecomb-kie/server/service"
"github.com/apache/servicecomb-kie/server/service/mongo/session"
- "github.com/go-mesh/openlogging"
+ "github.com/go-chassis/openlog"
uuid "github.com/satori/go.uuid"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
@@ -62,12 +62,12 @@ func (s *Service) Create(ctx context.Context, viewDoc
*model.ViewDoc, options ..
viewDoc.Criteria = "" //TODO parse pipe line to sql-like lang
err := create(ctx, viewDoc)
if err != nil {
- openlogging.Error("can not insert view collection: " +
err.Error())
+ openlog.Error("can not insert view collection: " + err.Error())
return nil, session.ErrViewCreation
}
err = session.CreateView(ctx, generateViewName(viewDoc.ID,
viewDoc.Domain, viewDoc.Project), session.CollectionKV, pipeline)
if err != nil {
- openlogging.Error("can not create view: " + err.Error())
+ openlog.Error("can not create view: " + err.Error())
return nil, session.ErrViewCreation
}
return viewDoc, nil
@@ -104,7 +104,7 @@ func (s *Service) Update(ctx context.Context, viewDoc
*model.ViewDoc) error {
}},
})
if err != nil {
- openlogging.Error("can not update view: " + err.Error())
+ openlog.Error("can not update view: " + err.Error())
return session.ErrViewUpdate
}
//TODO delete and create a new view
@@ -126,14 +126,14 @@ func (s *Service) List(ctx context.Context, domain,
project string, opts ...serv
}
cur, err := collection.Find(ctx, filter, mOpt)
if err != nil {
- openlogging.Error("can not find view: " + err.Error())
+ openlog.Error("can not find view: " + err.Error())
return nil, session.ErrViewFinding
}
result := &model.ViewResponse{}
for cur.Next(ctx) {
v := &model.ViewDoc{}
if err := cur.Decode(v); err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return nil, err
}
result.Data = append(result.Data, v)
@@ -155,14 +155,14 @@ func (s *Service) GetContent(ctx context.Context, id,
domain, project string, op
collection := session.GetDB().Collection(generateViewName(id, domain,
project))
cur, err := collection.Find(ctx, bson.D{}, mOpt)
if err != nil {
- openlogging.Error("can not find view content: " + err.Error())
+ openlog.Error("can not find view content: " + err.Error())
return nil, session.ErrViewFinding
}
result := &model.KVResponse{}
for cur.Next(ctx) {
v := &model.KVDoc{}
if err := cur.Decode(v); err != nil {
- openlogging.Error("decode error: " + err.Error())
+ openlog.Error("decode error: " + err.Error())
return nil, err
}
result.Data = append(result.Data, v)