@@ -77,9 +77,9 @@ type usageError struct {
7777 error
7878}
7979
80- // Logger is an instance of log.Logger that is use to provide debug information about running Sentry Client
81- // can be enabled by either using Logger .SetOutput directly or with Debug client option.
82- var Logger = log .New (io .Discard , "[Sentry] " , log .LstdFlags )
80+ // DebugLogger is an instance of log.Logger that is used to provide debug information about running Sentry Client
81+ // can be enabled by either using DebugLogger .SetOutput directly or with Debug client option.
82+ var DebugLogger = log .New (io .Discard , "[Sentry] " , log .LstdFlags )
8383
8484// EventProcessor is a function that processes an event.
8585// Event processors are used to change an event before it is sent to Sentry.
@@ -275,7 +275,7 @@ func NewClient(options ClientOptions) (*Client, error) {
275275 if debugWriter == nil {
276276 debugWriter = os .Stderr
277277 }
278- Logger .SetOutput (debugWriter )
278+ DebugLogger .SetOutput (debugWriter )
279279 }
280280
281281 if options .Dsn == "" {
@@ -383,12 +383,12 @@ func (client *Client) setupIntegrations() {
383383
384384 for _ , integration := range integrations {
385385 if client .integrationAlreadyInstalled (integration .Name ()) {
386- Logger .Printf ("Integration %s is already installed\n " , integration .Name ())
386+ DebugLogger .Printf ("Integration %s is already installed\n " , integration .Name ())
387387 continue
388388 }
389389 client .integrations = append (client .integrations , integration )
390390 integration .SetupOnce (client )
391- Logger .Printf ("Integration installed: %s\n " , integration .Name ())
391+ DebugLogger .Printf ("Integration installed: %s\n " , integration .Name ())
392392 }
393393
394394 sort .Slice (client .integrations , func (i , j int ) bool {
@@ -605,7 +605,7 @@ func (client *Client) processEvent(event *Event, hint *EventHint, scope EventMod
605605 // options.TracesSampler when they are started. Other events
606606 // (errors, messages) are sampled here. Does not apply to check-ins.
607607 if event .Type != transactionType && event .Type != checkInType && ! sample (client .options .SampleRate ) {
608- Logger .Println ("Event dropped due to SampleRate hit." )
608+ DebugLogger .Println ("Event dropped due to SampleRate hit." )
609609 return nil
610610 }
611611
@@ -620,13 +620,13 @@ func (client *Client) processEvent(event *Event, hint *EventHint, scope EventMod
620620 if event .Type == transactionType && client .options .BeforeSendTransaction != nil {
621621 // Transaction events
622622 if event = client .options .BeforeSendTransaction (event , hint ); event == nil {
623- Logger .Println ("Transaction dropped due to BeforeSendTransaction callback." )
623+ DebugLogger .Println ("Transaction dropped due to BeforeSendTransaction callback." )
624624 return nil
625625 }
626626 } else if event .Type != transactionType && event .Type != checkInType && client .options .BeforeSend != nil {
627627 // All other events
628628 if event = client .options .BeforeSend (event , hint ); event == nil {
629- Logger .Println ("Event dropped due to BeforeSend callback." )
629+ DebugLogger .Println ("Event dropped due to BeforeSend callback." )
630630 return nil
631631 }
632632 }
@@ -692,7 +692,7 @@ func (client *Client) prepareEvent(event *Event, hint *EventHint, scope EventMod
692692 id := event .EventID
693693 event = processor (event , hint )
694694 if event == nil {
695- Logger .Printf ("Event dropped by one of the Client EventProcessors: %s\n " , id )
695+ DebugLogger .Printf ("Event dropped by one of the Client EventProcessors: %s\n " , id )
696696 return nil
697697 }
698698 }
@@ -701,7 +701,7 @@ func (client *Client) prepareEvent(event *Event, hint *EventHint, scope EventMod
701701 id := event .EventID
702702 event = processor (event , hint )
703703 if event == nil {
704- Logger .Printf ("Event dropped by one of the Global EventProcessors: %s\n " , id )
704+ DebugLogger .Printf ("Event dropped by one of the Global EventProcessors: %s\n " , id )
705705 return nil
706706 }
707707 }
0 commit comments