Skip to content

Commit

Permalink
remove println which breaks json parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
KristopherPaulsen committed Jul 17, 2024
1 parent 44f2da9 commit 71c0440
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"

"github.com/inconshreveable/log15"
"gopkg.in/yaml.v3"

po "golang.ngrok.com/ngrok/policy"
Expand Down Expand Up @@ -77,7 +78,8 @@ func (p *policy) ApplyTCP(opts *tcpOptions) {

// policyToString converts the policy into a JSON string representation. This is to help remap Policy to TrafficPolicy.
func policyToString(p *policy) string {
fmt.Println("WithPolicy has been deprecated. Please use WithPolicyString instead, as WithPolicy will stop working soon.")
logger := log15.New()
logger.Warn("WithPolicy has been deprecated. Please use WithPolicyString instead, as WithPolicy will stop working soon.")

val, err := json.Marshal(p)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ func (s *sessionImpl) ListenAndServeHTTP(ctx context.Context, cfg config.Tunnel,
impl.server = server
} else {
// Inform end user that they're using a deprecated option.
fmt.Println("Tunnel is serving an HTTP server via HTTP options. This has been deprecated. Please use Session.ListenAndServeHTTP instead.")
s.inner().Logger.Warn("Tunnel is serving an HTTP server via HTTP options. This has been deprecated. Please use Session.ListenAndServeHTTP instead.")
}
}

Expand Down

0 comments on commit 71c0440

Please sign in to comment.