This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch release-v0.21
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.21 by this push:
new 5012c2fe2 fix(helper): remove debug logs (#7179)
5012c2fe2 is described below
commit 5012c2fe23d974c75729205a99c9b64b0fb1b90a
Author: Lynwee <[email protected]>
AuthorDate: Fri Mar 15 17:36:06 2024 +0800
fix(helper): remove debug logs (#7179)
* fix(helper): remove debug logs
* fix(helper): remove logs
---------
Co-authored-by: houlinwei <[email protected]>
---
backend/core/plugin/hub.go | 2 +-
.../helpers/pluginhelper/api/connection_helper.go | 29 +---------------------
backend/plugins/jira/api/connection_api.go | 4 ---
backend/plugins/jira/api/init.go | 1 -
backend/plugins/jira/impl/impl.go | 1 -
5 files changed, 2 insertions(+), 35 deletions(-)
diff --git a/backend/core/plugin/hub.go b/backend/core/plugin/hub.go
index a7f9c9f2c..82443b87d 100644
--- a/backend/core/plugin/hub.go
+++ b/backend/core/plugin/hub.go
@@ -80,7 +80,7 @@ func InitPlugins(basicRes context.BasicRes) {
if err != nil {
panic(fmt.Errorf("failed to initialize plugin
%v due to %w", pluginName, err))
} else {
- basicRes.GetLogger().Info("init plugin: %s
done", pluginName)
+ basicRes.GetLogger().Info("init plugin: %s
successfully", pluginName)
}
} else {
basicRes.GetLogger().Info("plugin: %s doesn't implement
'PluginInit', it will be skipped.", pluginName)
diff --git a/backend/helpers/pluginhelper/api/connection_helper.go
b/backend/helpers/pluginhelper/api/connection_helper.go
index 677f350bc..5e306519c 100644
--- a/backend/helpers/pluginhelper/api/connection_helper.go
+++ b/backend/helpers/pluginhelper/api/connection_helper.go
@@ -53,7 +53,7 @@ func NewConnectionHelper(
if vld == nil {
vld = validator.New()
}
- h := &ConnectionApiHelper{
+ return &ConnectionApiHelper{
encryptionSecret: basicRes.GetConfig(plugin.EncodeKeyEnvStr),
log: basicRes.GetLogger(),
db: basicRes.GetDal(),
@@ -61,14 +61,6 @@ func NewConnectionHelper(
bpManager:
services.NewBlueprintManager(basicRes.GetDal()),
pluginName: pluginName,
}
- if h.db == nil {
- h.log.Info("connection api helper db is nil")
- fmt.Println("connection api helper db is nil")
- } else {
- h.log.Info("connection api helper db is not nil")
- fmt.Println("connection api helper db is not nil")
- }
- return h
}
// Create a connection record based on request body
@@ -127,25 +119,6 @@ func (c *ConnectionApiHelper) FirstById(connection
interface{}, id uint64) error
// List returns all connections with password/token decrypted
func (c *ConnectionApiHelper) List(connections interface{}) errors.Error {
- if c == nil {
- c.log.Info("connection api helper is nil")
- fmt.Printf("connection api helper is nil\n")
- } else {
- c.log.Info("%s, connections :%+v", c.pluginName, connections)
- fmt.Printf("%s connections :%+v\n", c.pluginName, connections)
- c.log.Info("%s connection api helper :%+v", c.pluginName, c)
- fmt.Printf("%s connection api helper :%+v\n", c.pluginName, c)
- c.log.Info("%s connection api helper is not nil", c.pluginName)
- fmt.Printf("%s connection api helper is not nil\n",
c.pluginName)
- if c.db == nil {
- c.log.Info("%s connection api helper db is nil",
c.pluginName)
- fmt.Printf("%s connection api helper db is nil\n",
c.pluginName)
- } else {
- c.log.Info("%s connection api helper db is not nil",
c.pluginName)
- fmt.Printf("%s connection api helper db is not nil",
c.pluginName)
- }
- }
-
return CallDB(c.db.All, connections)
}
diff --git a/backend/plugins/jira/api/connection_api.go
b/backend/plugins/jira/api/connection_api.go
index 760a46b37..9b6071b15 100644
--- a/backend/plugins/jira/api/connection_api.go
+++ b/backend/plugins/jira/api/connection_api.go
@@ -206,10 +206,6 @@ func DeleteConnection(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutput
// @Failure 500 {string} errcode.Error "Internal Error"
// @Router /plugins/jira/connections [GET]
func ListConnections(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutput, errors.Error) {
- basicRes.GetLogger().Info("ds helper %+v", dsHelper)
- if dsHelper != nil {
- basicRes.GetLogger().Info("ds helper dsHelper %+v",
dsHelper.ConnApi)
- }
return dsHelper.ConnApi.GetAll(input)
}
diff --git a/backend/plugins/jira/api/init.go b/backend/plugins/jira/api/init.go
index 34a26228e..86ca5caa4 100644
--- a/backend/plugins/jira/api/init.go
+++ b/backend/plugins/jira/api/init.go
@@ -50,7 +50,6 @@ func Init(br context.BasicRes, p plugin.PluginMeta) {
nil,
nil,
)
- basicRes.GetLogger().Info("init dshelper: %+v", dsHelper)
raProxy =
api.NewDsRemoteApiProxyHelper[models.JiraConnection](dsHelper.ConnApi.ModelApiHelper)
raScopeList = api.NewDsRemoteApiScopeListHelper[models.JiraConnection,
models.JiraBoard, JiraRemotePagination](raProxy, listJiraRemoteScopes)
raScopeSearch =
api.NewDsRemoteApiScopeSearchHelper[models.JiraConnection,
models.JiraBoard](raProxy, searchJiraRemoteBoards)
diff --git a/backend/plugins/jira/impl/impl.go
b/backend/plugins/jira/impl/impl.go
index 542a2e05b..542c4159f 100644
--- a/backend/plugins/jira/impl/impl.go
+++ b/backend/plugins/jira/impl/impl.go
@@ -62,7 +62,6 @@ func (p Jira) ScopeConfig() dal.Tabler {
func (p Jira) Init(basicRes context.BasicRes) errors.Error {
api.Init(basicRes, p)
- fmt.Println("init jira with basic res and p", basicRes, p)
return nil
}