-
Notifications
You must be signed in to change notification settings - Fork 0
V0.0.16 test debug4 #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7c85195
8df82b6
76bda5b
2fef7e3
b6a08ef
e1374fd
b4b894c
787fc95
62870cc
d88d2b3
b06a2c0
8ebb157
a14abe3
4dd9fcf
60783ab
5dd1a8a
d730648
e5e335a
af1b480
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,17 +17,21 @@ | |
| var version = "dev" | ||
|
|
||
| func main() { | ||
| ctx := context.Background() | ||
| /*logger, _ := zap.NewProduction() | ||
| // logger, _ := zap.NewDevelopment() | ||
| defer logger.Sync() | ||
| _, cmd, err := configschema.DefineConfiguration(ctx, "baton-linear", getConnector, cfg.Config) | ||
| ctx := ctxzap.ToContext(context.Background(), logger) | ||
| */ | ||
| _, cmd, err := configschema.DefineConfiguration(context.Background(), "baton-linear", getConnector, cfg.Config) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Debug Code Leak Causes Logging FailuresCommented-out temporary debugging code for logger initialization and context setup was accidentally committed. This prevents proper Locations (1) |
||
| if err != nil { | ||
| fmt.Fprintln(os.Stderr, err.Error()) | ||
| os.Exit(1) | ||
| } | ||
|
|
||
| cmd.Version = version | ||
|
|
||
| err = cmd.Execute() | ||
| //err = cmd.ExecuteContext(ctx) | ||
| if err != nil { | ||
| fmt.Fprintln(os.Stderr, err.Error()) | ||
| os.Exit(1) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ import ( | |
| ent "github.com/conductorone/baton-sdk/pkg/types/entitlement" | ||
| grant "github.com/conductorone/baton-sdk/pkg/types/grant" | ||
| rs "github.com/conductorone/baton-sdk/pkg/types/resource" | ||
| "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap" | ||
| "go.uber.org/zap" | ||
| ) | ||
|
|
||
| const ( | ||
|
|
@@ -52,6 +54,11 @@ func projectResource(project *linear.Project, parentId *v2.ResourceId) (*v2.Reso | |
| } | ||
|
|
||
| func (o *projectResourceType) List(ctx context.Context, parentId *v2.ResourceId, token *pagination.Token) ([]*v2.Resource, string, annotations.Annotations, error) { | ||
| l := ctxzap.Extract(ctx) | ||
| l.Debug("********** List debug project") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| l.Info("********** List info project") | ||
| zap.L().Debug("******List zap project debug") | ||
| zap.L().Info("******List zap project info") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| var annotations annotations.Annotations | ||
| bag, err := parsePageToken(token.Token, &v2.ResourceId{ResourceType: resourceTypeProject.Id}) | ||
| if err != nil { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,13 +22,21 @@ type Client struct { | |
| } | ||
|
|
||
| func NewClient(ctx context.Context, apiKey string) (*Client, error) { | ||
| options := []uhttp.Option{uhttp.WithLogger(true, ctxzap.Extract(ctx))} | ||
| l := ctxzap.Extract(ctx) | ||
| options := []uhttp.Option{uhttp.WithLogger(true, l)} | ||
| ctx = ctxzap.ToContext(ctx, l) | ||
|
|
||
| httpClient, err := uhttp.NewClient(ctx, options...) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("creating HTTP client failed: %w", err) | ||
| } | ||
| wrapper := uhttp.NewBaseHttpClient(httpClient) | ||
| wrapper, err := uhttp.NewBaseHttpClientWithContext(ctx, httpClient) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| l.Info("************* Linear New client debug") | ||
| l.Debug("************* Linear New client debug") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Debug Logs Committed to CodebaseTemporary debug logging statements, characterized by asterisk patterns such as Locations (2)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Compilation Error and Debug LoggingThe Locations (1)There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Debug Logging Overriding User SettingsThe log level is hardcoded to "debug" in multiple Locations (5)
|
||
|
|
||
| apiUrl, err := url.Parse(APIEndpoint) | ||
| if err != nil { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.