Skip to content

Commit 5012c2f

Browse files
d4x1HouLinwei
andauthored
fix(helper): remove debug logs (#7179)
* fix(helper): remove debug logs * fix(helper): remove logs --------- Co-authored-by: houlinwei <timeror@gmail.com>
1 parent 8c666a0 commit 5012c2f

File tree

5 files changed

+2
-35
lines changed

5 files changed

+2
-35
lines changed

backend/core/plugin/hub.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func InitPlugins(basicRes context.BasicRes) {
8080
if err != nil {
8181
panic(fmt.Errorf("failed to initialize plugin %v due to %w", pluginName, err))
8282
} else {
83-
basicRes.GetLogger().Info("init plugin: %s done", pluginName)
83+
basicRes.GetLogger().Info("init plugin: %s successfully", pluginName)
8484
}
8585
} else {
8686
basicRes.GetLogger().Info("plugin: %s doesn't implement 'PluginInit', it will be skipped.", pluginName)

backend/helpers/pluginhelper/api/connection_helper.go

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,14 @@ func NewConnectionHelper(
5353
if vld == nil {
5454
vld = validator.New()
5555
}
56-
h := &ConnectionApiHelper{
56+
return &ConnectionApiHelper{
5757
encryptionSecret: basicRes.GetConfig(plugin.EncodeKeyEnvStr),
5858
log: basicRes.GetLogger(),
5959
db: basicRes.GetDal(),
6060
validator: vld,
6161
bpManager: services.NewBlueprintManager(basicRes.GetDal()),
6262
pluginName: pluginName,
6363
}
64-
if h.db == nil {
65-
h.log.Info("connection api helper db is nil")
66-
fmt.Println("connection api helper db is nil")
67-
} else {
68-
h.log.Info("connection api helper db is not nil")
69-
fmt.Println("connection api helper db is not nil")
70-
}
71-
return h
7264
}
7365

7466
// Create a connection record based on request body
@@ -127,25 +119,6 @@ func (c *ConnectionApiHelper) FirstById(connection interface{}, id uint64) error
127119

128120
// List returns all connections with password/token decrypted
129121
func (c *ConnectionApiHelper) List(connections interface{}) errors.Error {
130-
if c == nil {
131-
c.log.Info("connection api helper is nil")
132-
fmt.Printf("connection api helper is nil\n")
133-
} else {
134-
c.log.Info("%s, connections :%+v", c.pluginName, connections)
135-
fmt.Printf("%s connections :%+v\n", c.pluginName, connections)
136-
c.log.Info("%s connection api helper :%+v", c.pluginName, c)
137-
fmt.Printf("%s connection api helper :%+v\n", c.pluginName, c)
138-
c.log.Info("%s connection api helper is not nil", c.pluginName)
139-
fmt.Printf("%s connection api helper is not nil\n", c.pluginName)
140-
if c.db == nil {
141-
c.log.Info("%s connection api helper db is nil", c.pluginName)
142-
fmt.Printf("%s connection api helper db is nil\n", c.pluginName)
143-
} else {
144-
c.log.Info("%s connection api helper db is not nil", c.pluginName)
145-
fmt.Printf("%s connection api helper db is not nil", c.pluginName)
146-
}
147-
}
148-
149122
return CallDB(c.db.All, connections)
150123
}
151124

backend/plugins/jira/api/connection_api.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ func DeleteConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput
206206
// @Failure 500 {string} errcode.Error "Internal Error"
207207
// @Router /plugins/jira/connections [GET]
208208
func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) {
209-
basicRes.GetLogger().Info("ds helper %+v", dsHelper)
210-
if dsHelper != nil {
211-
basicRes.GetLogger().Info("ds helper dsHelper %+v", dsHelper.ConnApi)
212-
}
213209
return dsHelper.ConnApi.GetAll(input)
214210
}
215211

backend/plugins/jira/api/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func Init(br context.BasicRes, p plugin.PluginMeta) {
5050
nil,
5151
nil,
5252
)
53-
basicRes.GetLogger().Info("init dshelper: %+v", dsHelper)
5453
raProxy = api.NewDsRemoteApiProxyHelper[models.JiraConnection](dsHelper.ConnApi.ModelApiHelper)
5554
raScopeList = api.NewDsRemoteApiScopeListHelper[models.JiraConnection, models.JiraBoard, JiraRemotePagination](raProxy, listJiraRemoteScopes)
5655
raScopeSearch = api.NewDsRemoteApiScopeSearchHelper[models.JiraConnection, models.JiraBoard](raProxy, searchJiraRemoteBoards)

backend/plugins/jira/impl/impl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func (p Jira) ScopeConfig() dal.Tabler {
6262

6363
func (p Jira) Init(basicRes context.BasicRes) errors.Error {
6464
api.Init(basicRes, p)
65-
fmt.Println("init jira with basic res and p", basicRes, p)
6665
return nil
6766
}
6867

0 commit comments

Comments
 (0)