logging: pt1
This commit is contained in:
3
external/githubissuelabeler.go
vendored
3
external/githubissuelabeler.go
vendored
@@ -3,6 +3,7 @@ package external
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
|
||||
"github.com/google/go-github/v61/github"
|
||||
@@ -52,7 +53,7 @@ func (g *GithubIssuesLabeler) Run(params action.ActionParams) (string, error) {
|
||||
labels, _, err := g.client.Issues.AddLabelsToIssue(g.context, result.Owner, result.Repository, result.IssueNumber, []string{result.Label})
|
||||
//labelsNames := []string{}
|
||||
for _, l := range labels {
|
||||
fmt.Println("Label added:", l.Name)
|
||||
slog.Info("Label added:", l.Name)
|
||||
//labelsNames = append(labelsNames, l.GetName())
|
||||
}
|
||||
|
||||
|
||||
3
external/githubissuesearch.go
vendored
3
external/githubissuesearch.go
vendored
@@ -3,6 +3,7 @@ package external
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/google/go-github/v61/github"
|
||||
"github.com/mudler/local-agent-framework/action"
|
||||
@@ -49,7 +50,7 @@ func (g *GithubIssueSearch) Run(params action.ActionParams) (string, error) {
|
||||
resultString = fmt.Sprintf("Error listing issues: %v", err)
|
||||
}
|
||||
for _, i := range issues.Issues {
|
||||
fmt.Println("Issue found:", i.GetTitle())
|
||||
slog.Info("Issue found:", i.GetTitle())
|
||||
resultString += fmt.Sprintf("Issue found: %s\n", i.GetTitle())
|
||||
resultString += fmt.Sprintf("URL: %s\n", i.GetHTMLURL())
|
||||
// resultString += fmt.Sprintf("Body: %s\n", i.GetBody())
|
||||
|
||||
3
external/search.go
vendored
3
external/search.go
vendored
@@ -2,6 +2,7 @@ package external
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/mudler/local-agent-framework/action"
|
||||
"github.com/sap-nocops/duckduckgogo/client"
|
||||
@@ -20,7 +21,7 @@ func NewSearch(config map[string]string) *SearchAction {
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println("Search action with results: ", intResult)
|
||||
slog.Info("Search action with results: ", intResult)
|
||||
return &SearchAction{results: intResult}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user