Remove all uses of CORSO_URL_LOGGING (#3406)
https://github.com/alcionai/corso/pull/3212#discussion_r1191768302 --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [x] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
4dc9bf9d64
commit
729543999f
@ -3,7 +3,6 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
"github.com/microsoft/kiota-abstractions-go/serialization"
|
||||
@ -16,7 +15,6 @@ import (
|
||||
"github.com/alcionai/corso/src/internal/connector/graph/api"
|
||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||
"github.com/alcionai/corso/src/pkg/fault"
|
||||
"github.com/alcionai/corso/src/pkg/logger"
|
||||
"github.com/alcionai/corso/src/pkg/selectors"
|
||||
)
|
||||
|
||||
@ -221,16 +219,6 @@ func NewContactPager(
|
||||
|
||||
builder := gs.Client().UsersById(user).ContactFoldersById(directoryID).Contacts()
|
||||
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := builder.ToGetRequestInformation(ctx, options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
|
||||
return &contactPager{gs, builder, options}, nil
|
||||
}
|
||||
|
||||
@ -276,16 +264,6 @@ func getContactDeltaBuilder(
|
||||
options *users.ItemContactFoldersItemContactsDeltaRequestBuilderGetRequestConfiguration,
|
||||
) *users.ItemContactFoldersItemContactsDeltaRequestBuilder {
|
||||
builder := gs.Client().UsersById(user).ContactFoldersById(directoryID).Contacts().Delta()
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := builder.ToGetRequestInformation(ctx, options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
|
||||
return builder
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
@ -18,7 +17,6 @@ import (
|
||||
"github.com/alcionai/corso/src/internal/connector/graph/api"
|
||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||
"github.com/alcionai/corso/src/pkg/fault"
|
||||
"github.com/alcionai/corso/src/pkg/logger"
|
||||
"github.com/alcionai/corso/src/pkg/path"
|
||||
)
|
||||
|
||||
@ -281,15 +279,6 @@ func NewEventPager(
|
||||
}
|
||||
|
||||
builder := gs.Client().UsersById(user).CalendarsById(calendarID).Events()
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := builder.ToGetRequestInformation(ctx, options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
|
||||
return &eventPager{gs, builder, options}, nil
|
||||
}
|
||||
@ -367,16 +356,6 @@ func getEventDeltaBuilder(
|
||||
rawURL := fmt.Sprintf(eventBetaDeltaURLTemplate, user, calendarID)
|
||||
builder := users.NewItemCalendarsItemEventsDeltaRequestBuilder(rawURL, gs.Adapter())
|
||||
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := builder.ToGetRequestInformation(ctx, options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
|
||||
return builder
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
"github.com/microsoft/kiota-abstractions-go/serialization"
|
||||
@ -383,16 +382,6 @@ func NewMailPager(
|
||||
|
||||
builder := gs.Client().UsersById(user).MailFoldersById(directoryID).Messages()
|
||||
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := builder.ToGetRequestInformation(ctx, options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
|
||||
return &mailPager{gs, builder, options}, nil
|
||||
}
|
||||
|
||||
@ -438,17 +427,6 @@ func getMailDeltaBuilder(
|
||||
options *users.ItemMailFoldersItemMessagesDeltaRequestBuilderGetRequestConfiguration,
|
||||
) *users.ItemMailFoldersItemMessagesDeltaRequestBuilder {
|
||||
builder := gs.Client().UsersById(user).MailFoldersById(directoryID).Messages().Delta()
|
||||
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := builder.ToGetRequestInformation(ctx, options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
|
||||
return builder
|
||||
}
|
||||
|
||||
@ -502,16 +480,6 @@ func (p *mailDeltaPager) setNext(nextLink string) {
|
||||
|
||||
func (p *mailDeltaPager) reset(ctx context.Context) {
|
||||
p.builder = p.gs.Client().UsersById(p.user).MailFoldersById(p.directoryID).Messages().Delta()
|
||||
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
gri, err := p.builder.ToGetRequestInformation(ctx, p.options)
|
||||
if err != nil {
|
||||
logger.CtxErr(ctx, err).Error("getting builder info")
|
||||
} else {
|
||||
logger.Ctx(ctx).
|
||||
Infow("builder path-parameters", "path_parameters", gri.PathParameters)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (p *mailDeltaPager) valuesIn(pl api.PageLinker) ([]getIDAndAddtler, error) {
|
||||
|
||||
@ -3,7 +3,6 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
|
||||
@ -169,15 +168,6 @@ func getItemsAddedAndRemovedFromContainer(
|
||||
deltaLink = "" // to make sure we don't use an old value
|
||||
}
|
||||
|
||||
if len(os.Getenv("CORSO_URL_LOGGING")) > 0 {
|
||||
if !api.IsNextLinkValid(nextLink) || !api.IsNextLinkValid(deltaLink) {
|
||||
logger.Ctx(ctx).
|
||||
With("next_link", graph.LoggableURL(nextLink)).
|
||||
With("delta_link", graph.LoggableURL(deltaLink)).
|
||||
Info("invalid link from M365")
|
||||
}
|
||||
}
|
||||
|
||||
// the deltaLink is kind of like a cursor for overall data state.
|
||||
// once we run through pages of nextLinks, the last query will
|
||||
// produce a deltaLink instead (if supported), which we'll use on
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user