Repository: newrelic/newrelic-client-go
Pull request #780 (2021-07-22 01:32:56)

fix(logging): export LogrusLogger for use in other projects
This will be used by https://github.com/newrelic/newrelic-cli/pull/1005 to pass in the logrus instance already defined in the CLI.


Patch:
diff --git a/.golangci.yml b/.golangci.yml
index cb3fdbd..515ab17 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -46,7 +46,7 @@ linters:
     - errcheck
     - gocyclo
     - gofmt
-    - golint
+    - revive
     - gosimple
     - govet
     - ineffassign
diff --git a/internal/http/client.go b/internal/http/client.go
index 08625c8..f484d90 100644
--- a/internal/http/client.go
+++ b/internal/http/client.go
@@ -14,10 +14,10 @@ import (
 
 	retryablehttp "github.com/hashicorp/go-retryablehttp"
 
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/internal/version"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
 	nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 const (
@@ -90,7 +90,7 @@ func NewClient(cfg config.Config) Client {
 	if cfg.Logger != nil {
 		logger = cfg.Logger
 	} else {
-		logger = logging.NewStructuredLogger()
+		logger = logging.NewLogrusLogger()
 	}
 
 	client := Client{
diff --git a/newrelic/newrelic.go b/newrelic/newrelic.go
index 58b2689..ccc713d 100644
--- a/newrelic/newrelic.go
+++ b/newrelic/newrelic.go
@@ -7,7 +7,6 @@ import (
 
 	log "github.com/sirupsen/logrus"
 
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/accounts"
 	"github.com/newrelic/newrelic-client-go/pkg/alerts"
 	"github.com/newrelic/newrelic-client-go/pkg/apiaccess"
@@ -20,6 +19,7 @@ import (
 	"github.com/newrelic/newrelic-client-go/pkg/events"
 	"github.com/newrelic/newrelic-client-go/pkg/eventstometrics"
 	"github.com/newrelic/newrelic-client-go/pkg/installevents"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/logs"
 	"github.com/newrelic/newrelic-client-go/pkg/nerdgraph"
 	"github.com/newrelic/newrelic-client-go/pkg/nerdstorage"
diff --git a/pkg/accounts/accounts.go b/pkg/accounts/accounts.go
index 4628a8f..fd01b82 100644
--- a/pkg/accounts/accounts.go
+++ b/pkg/accounts/accounts.go
@@ -5,8 +5,8 @@ import (
 	"context"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Accounts is used to interact with New Relic accounts.
diff --git a/pkg/alerts/alerts.go b/pkg/alerts/alerts.go
index 7ce507d..d32693a 100644
--- a/pkg/alerts/alerts.go
+++ b/pkg/alerts/alerts.go
@@ -2,9 +2,9 @@ package alerts
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
 	"github.com/newrelic/newrelic-client-go/pkg/infrastructure"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Alerts is used to communicate with New Relic Alerts.
diff --git a/pkg/alerts/muting_rules.go b/pkg/alerts/muting_rules.go
index fcceac8..c7e32ce 100644
--- a/pkg/alerts/muting_rules.go
+++ b/pkg/alerts/muting_rules.go
@@ -250,11 +250,7 @@ func (a *Alerts) DeleteMutingRuleWithContext(ctx context.Context, accountID int,
 
 	resp := alertMutingRuleDeleteResponse{}
 
-	if err := a.client.NerdGraphQueryWithContext(ctx, alertsMutingRuleDelete, vars, &resp); err != nil {
-		return err
-	}
-
-	return nil
+	return a.client.NerdGraphQueryWithContext(ctx, alertsMutingRuleDelete, vars, &resp)
 }
 
 type alertMutingRuleCreateResponse struct {
diff --git a/pkg/alerts/nrql_conditions.go b/pkg/alerts/nrql_conditions.go
index 0b41def..b38ad2b 100644
--- a/pkg/alerts/nrql_conditions.go
+++ b/pkg/alerts/nrql_conditions.go
@@ -11,7 +11,7 @@ import (
 
 // AlertsNrqlConditionExpiration
 // Settings for how violations are opened or closed when a signal expires.
-// nolint:golint
+// nolint:revive
 type AlertsNrqlConditionExpiration struct {
 	ExpirationDuration          *int `json:"expirationDuration"`
 	CloseViolationsOnExpiration bool `json:"closeViolationsOnExpiration"`
@@ -19,7 +19,7 @@ type AlertsNrqlConditionExpiration struct {
 }
 
 // AlertsNrqlConditionSignal - Configuration that defines the signal that the NRQL condition will use to evaluate.
-// nolint:golint
+// nolint:revive
 type AlertsNrqlConditionSignal struct {
 	AggregationWindow *int              `json:"aggregationWindow,omitempty"`
 	EvaluationOffset  *int              `json:"evaluationOffset,omitempty"`
@@ -28,8 +28,10 @@ type AlertsNrqlConditionSignal struct {
 }
 
 // AlertsFillOption - The available fill options.
+// nolint:revive
 type AlertsFillOption string // nolint:golint
 
+// nolint:revive
 var AlertsFillOptionTypes = struct {
 	// Fill using the last known value.
 	LAST_VALUE AlertsFillOption // nolint:golint
diff --git a/pkg/apiaccess/apiaccess.go b/pkg/apiaccess/apiaccess.go
index 421541b..26fb2a3 100644
--- a/pkg/apiaccess/apiaccess.go
+++ b/pkg/apiaccess/apiaccess.go
@@ -3,8 +3,8 @@ package apiaccess
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // APIAccess is used to communicate with the New Relic APIKeys product.
diff --git a/pkg/cloud/cloud.go b/pkg/cloud/cloud.go
index 6be0564..7915c8a 100644
--- a/pkg/cloud/cloud.go
+++ b/pkg/cloud/cloud.go
@@ -2,8 +2,8 @@ package cloud
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 type Cloud struct {
diff --git a/pkg/config/config.go b/pkg/config/config.go
index a6dc28c..f07c4cb 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -5,8 +5,8 @@ import (
 	"net/http"
 	"time"
 
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/internal/version"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/region"
 )
 
@@ -96,7 +96,7 @@ func (c *Config) GetLogger() logging.Logger {
 		return c.Logger
 	}
 
-	l := logging.NewStructuredLogger()
+	l := logging.NewLogrusLogger()
 	l.SetDefaultFields(map[string]string{"newrelic-client-go": version.Version})
 	l.SetLogJSON(c.LogJSON)
 	l.SetLevel(c.LogLevel)
diff --git a/pkg/dashboards/dashboards.go b/pkg/dashboards/dashboards.go
index 2c13b4b..02503d0 100644
--- a/pkg/dashboards/dashboards.go
+++ b/pkg/dashboards/dashboards.go
@@ -3,8 +3,8 @@ package dashboards
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Dashboards is used to communicate with the New Relic Dashboards product.
diff --git a/pkg/edge/edge.go b/pkg/edge/edge.go
index b9d7a7d..f9581af 100644
--- a/pkg/edge/edge.go
+++ b/pkg/edge/edge.go
@@ -3,8 +3,8 @@ package edge
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Edge is used to communicate with the New Relic Edge product.
diff --git a/pkg/entities/entities.go b/pkg/entities/entities.go
index 4b59168..d117c93 100644
--- a/pkg/entities/entities.go
+++ b/pkg/entities/entities.go
@@ -3,8 +3,8 @@ package entities
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Entities is used to communicate with the New Relic Entities product.
diff --git a/pkg/events/events.go b/pkg/events/events.go
index 9dc364c..06f8968 100644
--- a/pkg/events/events.go
+++ b/pkg/events/events.go
@@ -9,8 +9,8 @@ import (
 	"time"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 const (
diff --git a/pkg/eventstometrics/eventstometrics.go b/pkg/eventstometrics/eventstometrics.go
index 1178a41..514f265 100644
--- a/pkg/eventstometrics/eventstometrics.go
+++ b/pkg/eventstometrics/eventstometrics.go
@@ -7,9 +7,9 @@ import (
 	"strings"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
 	nrErrors "github.com/newrelic/newrelic-client-go/pkg/errors"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // EventsToMetrics is used to communicate with New Relic EventsToMetrics.
diff --git a/pkg/installevents/installevents.go b/pkg/installevents/installevents.go
index 2eb2b8e..0367cb0 100644
--- a/pkg/installevents/installevents.go
+++ b/pkg/installevents/installevents.go
@@ -2,8 +2,8 @@ package installevents
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Installevents is used to communicate with the Install Events Service.
diff --git a/internal/logging/logger.go b/pkg/logging/logger.go
similarity index 100%
rename from internal/logging/logger.go
rename to pkg/logging/logger.go
diff --git a/internal/logging/structured_logger.go b/pkg/logging/logrus_logger.go
similarity index 63%
rename from internal/logging/structured_logger.go
rename to pkg/logging/logrus_logger.go
index 1395f5c..dba3fca 100644
--- a/internal/logging/structured_logger.go
+++ b/pkg/logging/logrus_logger.go
@@ -11,20 +11,37 @@ var (
 	defaultLogLevel = "info"
 )
 
-// StructuredLogger is a logger based on logrus.
-type StructuredLogger struct {
+// LogrusLogger is a logger based on logrus.
+type LogrusLogger struct {
 	logger *log.Logger
 }
 
-// NewStructuredLogger creates a new structured logger.
-func NewStructuredLogger() *StructuredLogger {
-	return &StructuredLogger{
+type ConfigOption func(*LogrusLogger)
+
+func ConfigLoggerInstance(logger *log.Logger) ConfigOption {
+	return func(l *LogrusLogger) {
+		l.logger = logger
+	}
+}
+
+// NewLogrusLogger creates a new structured logger.
+func NewLogrusLogger(opts ...ConfigOption) *LogrusLogger {
+	l := &LogrusLogger{
 		logger: log.New(),
 	}
+
+	// Loop through config options
+	for _, fn := range opts {
+		if nil != fn {
+			fn(l)
+		}
+	}
+
+	return l
 }
 
 // SetLevel allows the log level to be set.
-func (l StructuredLogger) SetLevel(levelName string) {
+func (l LogrusLogger) SetLevel(levelName string) {
 	if levelName == "" {
 		levelName = defaultLogLevel
 	}
@@ -39,39 +56,39 @@ func (l StructuredLogger) SetLevel(levelName string) {
 }
 
 // LogJSON determines whether or not to format the logs as JSON.
-func (l StructuredLogger) SetLogJSON(value bool) {
+func (l LogrusLogger) SetLogJSON(value bool) {
 	if value {
 		l.logger.SetFormatter(&log.JSONFormatter{})
 	}
 }
 
 // SetDefaultFields sets fields to be logged on every use of the logger.
-func (l StructuredLogger) SetDefaultFields(defaultFields map[string]string) {
+func (l LogrusLogger) SetDefaultFields(defaultFields map[string]string) {
 	l.logger.AddHook(&defaultFieldHook{})
 }
 
 // Error logs an error message.
-func (l StructuredLogger) Error(msg string, fields ...interface{}) {
+func (l LogrusLogger) Error(msg string, fields ...interface{}) {
 	l.logger.WithFields(createFieldMap(fields)).Error(msg)
 }
 
 // Warn logs an warning message.
-func (l StructuredLogger) Warn(msg string, fields ...interface{}) {
+func (l LogrusLogger) Warn(msg string, fields ...interface{}) {
 	l.logger.WithFields(createFieldMap(fields)).Warn(msg)
 }
 
 // Info logs an info message.
-func (l StructuredLogger) Info(msg string, fields ...interface{}) {
+func (l LogrusLogger) Info(msg string, fields ...interface{}) {
 	l.logger.WithFields(createFieldMap(fields)).Info(msg)
 }
 
 // Debug logs a debug message.
-func (l StructuredLogger) Debug(msg string, fields ...interface{}) {
+func (l LogrusLogger) Debug(msg string, fields ...interface{}) {
 	l.logger.WithFields(createFieldMap(fields)).Debug(msg)
 }
 
 // Trace logs a trace message.
-func (l StructuredLogger) Trace(msg string, fields ...interface{}) {
+func (l LogrusLogger) Trace(msg string, fields ...interface{}) {
 	l.logger.WithFields(createFieldMap(fields)).Trace(msg)
 }
 
diff --git a/internal/logging/mock_logger.go b/pkg/logging/mock_logger.go
similarity index 100%
rename from internal/logging/mock_logger.go
rename to pkg/logging/mock_logger.go
diff --git a/internal/logging/mock_logger_test.go b/pkg/logging/mock_logger_test.go
similarity index 100%
rename from internal/logging/mock_logger_test.go
rename to pkg/logging/mock_logger_test.go
diff --git a/pkg/logs/logs.go b/pkg/logs/logs.go
index 1f0e20d..7173f61 100644
--- a/pkg/logs/logs.go
+++ b/pkg/logs/logs.go
@@ -5,8 +5,8 @@ import (
 	"time"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Logs is used to send log data to the New Relic Log API
diff --git a/pkg/nerdgraph/nerdgraph.go b/pkg/nerdgraph/nerdgraph.go
index c203f23..9ec93c5 100644
--- a/pkg/nerdgraph/nerdgraph.go
+++ b/pkg/nerdgraph/nerdgraph.go
@@ -5,8 +5,8 @@ import (
 	"context"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // NerdGraph is used to communicate with the New Relic's GraphQL API, NerdGraph.
@@ -58,11 +58,7 @@ func (n *NerdGraph) QueryWithResponse(query string, variables map[string]interfa
 // QueryWithResponseAndContext functions similarly to QueryWithContext, but alows for full customization of the returned data payload.
 // QueryWithContext should be preferred most of the time.
 func (n *NerdGraph) QueryWithResponseAndContext(ctx context.Context, query string, variables map[string]interface{}, respBody interface{}) error {
-	if err := n.client.NerdGraphQueryWithContext(ctx, query, variables, respBody); err != nil {
-		return err
-	}
-
-	return nil
+	return n.client.NerdGraphQueryWithContext(ctx, query, variables, respBody)
 }
 
 // AccountReference represents the NerdGraph schema for a New Relic account.
diff --git a/pkg/nerdstorage/nerdstorage.go b/pkg/nerdstorage/nerdstorage.go
index 065f239..f870daa 100644
--- a/pkg/nerdstorage/nerdstorage.go
+++ b/pkg/nerdstorage/nerdstorage.go
@@ -8,8 +8,8 @@ import (
 	"github.com/imdario/mergo"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 const (
diff --git a/pkg/nrdb/nrdb.go b/pkg/nrdb/nrdb.go
index 0e36bd7..7e14f7d 100644
--- a/pkg/nrdb/nrdb.go
+++ b/pkg/nrdb/nrdb.go
@@ -3,8 +3,8 @@ package nrdb
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Nrdb is used to communicate with the New Relic's Datastore, NRDB.
diff --git a/pkg/nrqldroprules/nrqldroprules.go b/pkg/nrqldroprules/nrqldroprules.go
index 0e05c2c..8350ea1 100644
--- a/pkg/nrqldroprules/nrqldroprules.go
+++ b/pkg/nrqldroprules/nrqldroprules.go
@@ -3,8 +3,8 @@ package nrqldroprules
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // NrqlDropRules is used to interact with New Relic accounts.
diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go
index cfddf50..0cc84d6 100644
--- a/pkg/plugins/plugins.go
+++ b/pkg/plugins/plugins.go
@@ -5,8 +5,8 @@ import (
 	"fmt"
 
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Plugins is used to communicate with the New Relic Plugins product.
diff --git a/pkg/synthetics/synthetics.go b/pkg/synthetics/synthetics.go
index d7e145f..98a2218 100644
--- a/pkg/synthetics/synthetics.go
+++ b/pkg/synthetics/synthetics.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 
 	nrhttp "github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Synthetics is used to communicate with the New Relic Synthetics product.
diff --git a/pkg/users/users.go b/pkg/users/users.go
index 4a57833..c3c1bd9 100644
--- a/pkg/users/users.go
+++ b/pkg/users/users.go
@@ -3,8 +3,8 @@ package users
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Users is used to interact with New Relic users.
diff --git a/pkg/workloads/workloads.go b/pkg/workloads/workloads.go
index 451142a..4d4747b 100644
--- a/pkg/workloads/workloads.go
+++ b/pkg/workloads/workloads.go
@@ -4,8 +4,8 @@ package workloads
 
 import (
 	"github.com/newrelic/newrelic-client-go/internal/http"
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 // Workloads is used to communicate with the New Relic Workloads product.


Test patch:
diff --git a/internal/http/client_test.go b/internal/http/client_test.go
index 8219fd0..7a05cd0 100644
--- a/internal/http/client_test.go
+++ b/internal/http/client_test.go
@@ -12,9 +12,9 @@ import (
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
 	"github.com/newrelic/newrelic-client-go/pkg/errors"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 	mock "github.com/newrelic/newrelic-client-go/pkg/testhelpers"
 )
 
diff --git a/newrelic/newrelic_test.go b/newrelic/newrelic_test.go
index ebce99f..c73bb59 100644
--- a/newrelic/newrelic_test.go
+++ b/newrelic/newrelic_test.go
@@ -11,8 +11,8 @@ import (
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
-	"github.com/newrelic/newrelic-client-go/internal/logging"
 	"github.com/newrelic/newrelic-client-go/pkg/config"
+	"github.com/newrelic/newrelic-client-go/pkg/logging"
 )
 
 var testAPIkey = "asdf1234"
diff --git a/internal/logging/structured_logger_test.go b/pkg/logging/logrus_logger_test.go
similarity index 78%
rename from internal/logging/structured_logger_test.go
rename to pkg/logging/logrus_logger_test.go
index 4534aa4..86cb908 100644
--- a/internal/logging/structured_logger_test.go
+++ b/pkg/logging/logrus_logger_test.go
@@ -9,12 +9,12 @@ import (
 	"github.com/stretchr/testify/assert"
 )
 
-func TestNewStructuredLogger_private(t *testing.T) {
+func TestNewLogrusLogger_private(t *testing.T) {
 	t.Parallel()
 
 	logrusLevel := log.GetLevel()
 
-	l := NewStructuredLogger()
+	l := NewLogrusLogger()
 
 	l.SetLevel("debug")
 
@@ -27,7 +27,7 @@ func TestNewStructuredLogger_private(t *testing.T) {
 
 func TestSetLevel(t *testing.T) {
 	t.Parallel()
-	l := NewStructuredLogger()
+	l := NewLogrusLogger()
 
 	defaultLevel, err := log.ParseLevel(defaultLogLevel)
 
@@ -43,7 +43,7 @@ func TestSetLevel(t *testing.T) {
 
 }
 
-func TestStructuredLogger_interface(t *testing.T) {
-	var l Logger = NewStructuredLogger()
+func TestLogrusLogger_interface(t *testing.T) {
+	var l Logger = NewLogrusLogger()
 	l.Info("testing")
 }