diff --git a/README.md b/README.md index d1d4a85..3251690 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ import Logrus as both upper- and lower-case. Due to the Go package environment, this caused issues in the community and we needed a standard. Some environments experienced problems with the upper-case variant, so the lower-case was decided. Everything using `logrus` will need to use the lower-case: -`github.com/sirupsen/logrus`. Any package that isn't, should be changed. +`git.corp.kornet35.ru/gopkg/logrus`. Any package that isn't, should be changed. To fix Glide, see [these comments](https://github.com/sirupsen/logrus/issues/553#issuecomment-306591437). @@ -72,6 +72,7 @@ time="2015-03-26T01:27:38-04:00" level=debug msg="Temperature changes" temperatu time="2015-03-26T01:27:38-04:00" level=panic msg="It's over 9000!" animal=orca size=9009 time="2015-03-26T01:27:38-04:00" level=fatal msg="The ice breaks!" err=&{0x2082280c0 map[animal:orca size:9009] 2015-03-26 01:27:38.441574009 -0400 EDT panic It's over 9000!} number=100 omg=true ``` + To ensure this behaviour even if a TTY is attached, set your formatter as follows: ```go @@ -84,32 +85,40 @@ To ensure this behaviour even if a TTY is attached, set your formatter as follow #### Logging Method Name If you wish to add the calling method as a field, instruct the logger via: + ```go log.SetReportCaller(true) ``` + This adds the caller as 'method' like so: ```json -{"animal":"penguin","level":"fatal","method":"github.com/sirupsen/arcticcreatures.migrate","msg":"a penguin swims by", -"time":"2014-03-10 19:57:38.562543129 -0400 EDT"} +{ + "animal": "penguin", + "level": "fatal", + "method": "github.com/sirupsen/arcticcreatures.migrate", + "msg": "a penguin swims by", + "time": "2014-03-10 19:57:38.562543129 -0400 EDT" +} ``` ```text time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcreatures.migrate msg="a penguin swims by" animal=penguin ``` + Note that this does add measurable overhead - the cost will depend on the version of Go, but is -between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your +between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your environment via benchmarks: + ``` go test -bench=.*CallerTracing ``` - #### Case-sensitivity The organization's name was changed to lower-case--and this will not be changed back. If you are getting import conflicts due to case sensitivity, please use -the lower-case import: `github.com/sirupsen/logrus`. +the lower-case import: `git.corp.kornet35.ru/gopkg/logrus`. #### Example @@ -119,7 +128,7 @@ The simplest way to use Logrus is simply the package-level exported logger: package main import ( - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" ) func main() { @@ -130,7 +139,7 @@ func main() { ``` Note that it's completely api-compatible with the stdlib logger, so you can -replace your `log` imports everywhere with `log "github.com/sirupsen/logrus"` +replace your `log` imports everywhere with `log "git.corp.kornet35.ru/gopkg/logrus"` and you'll now have the flexibility of Logrus. You can customize it all you want: @@ -139,7 +148,7 @@ package main import ( "os" - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" ) func init() { @@ -190,7 +199,7 @@ package main import ( "os" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) // Create a new instance of the logger. You can have any number of instances. @@ -265,9 +274,9 @@ Logrus comes with [built-in hooks](hooks/). Add those, or your custom hook, in ```go import ( - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" "gopkg.in/gemnasium/logrus-airbrake-hook.v2" // the package is named "airbrake" - logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" + logrus_syslog "git.corp.kornet35.ru/gopkg/logrus/hooks/syslog" "log/syslog" ) @@ -285,11 +294,11 @@ func init() { } } ``` + Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md). A list of currently known service hooks can be found in this wiki [page](https://github.com/sirupsen/logrus/wiki/Hooks) - #### Level logging Logrus has seven logging levels: Trace, Debug, Info, Warning, Error, Fatal and Panic. @@ -340,7 +349,7 @@ could do: ```go import ( - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" ) func init() { @@ -363,29 +372,29 @@ Splunk or Logstash. The built-in logging formatters are: -* `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise +- `logrus.TextFormatter`. Logs the event in colors if stdout is a tty, otherwise without colors. - * *Note:* to force colored output when there is no TTY, set the `ForceColors` - field to `true`. To force no colored output even if there is a TTY set the + - _Note:_ to force colored output when there is no TTY, set the `ForceColors` + field to `true`. To force no colored output even if there is a TTY set the `DisableColors` field to `true`. For Windows, see [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable). - * When colors are enabled, levels are truncated to 4 characters by default. To disable + - When colors are enabled, levels are truncated to 4 characters by default. To disable truncation set the `DisableLevelTruncation` field to `true`. - * When outputting to a TTY, it's often helpful to visually scan down a column where all the levels are the same width. Setting the `PadLevelText` field to `true` enables this behavior, by adding padding to the level text. - * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). -* `logrus.JSONFormatter`. Logs fields as JSON. - * All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). + - When outputting to a TTY, it's often helpful to visually scan down a column where all the levels are the same width. Setting the `PadLevelText` field to `true` enables this behavior, by adding padding to the level text. + - All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#TextFormatter). +- `logrus.JSONFormatter`. Logs fields as JSON. + - All options are listed in the [generated docs](https://godoc.org/github.com/sirupsen/logrus#JSONFormatter). Third party logging formatters: -* [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine. -* [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html). -* [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. -* [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. -* [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the Power of Zalgo. -* [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure. -* [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Sava log to files. -* [`caption-json-formatter`](https://github.com/nolleh/caption_json_formatter). logrus's message json formatter with human-readable caption added. +- [`FluentdFormatter`](https://github.com/joonix/log). Formats entries that can be parsed by Kubernetes and Google Container Engine. +- [`GELF`](https://github.com/fabienm/go-logrus-formatters). Formats entries so they comply to Graylog's [GELF 1.1 specification](http://docs.graylog.org/en/2.4/pages/gelf.html). +- [`logstash`](https://github.com/bshuster-repo/logrus-logstash-hook). Logs fields as [Logstash](http://logstash.net) Events. +- [`prefixed`](https://github.com/x-cray/logrus-prefixed-formatter). Displays log entry source along with alternative layout. +- [`zalgo`](https://github.com/aybabtme/logzalgo). Invoking the Power of Zalgo. +- [`nested-logrus-formatter`](https://github.com/antonfisher/nested-logrus-formatter). Converts logrus fields to a nested structure. +- [`powerful-logrus-formatter`](https://github.com/zput/zxcTool). get fileName, log's line number and the latest function's name when print log; Sava log to files. +- [`caption-json-formatter`](https://github.com/nolleh/caption_json_formatter). logrus's message json formatter with human-readable caption added. You can define your formatter by implementing the `Formatter` interface, requiring a `Format` method. `Format` takes an `*Entry`. `entry.Data` is a @@ -448,22 +457,22 @@ entries. It should not be a feature of the application-level logger. #### Tools -| Tool | Description | -| ---- | ----------- | -|[Logrus Mate](https://github.com/gogap/logrus_mate)|Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will be generated with different configs in different environments.| -|[Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper)|An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | +| Tool | Description | +| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Logrus Mate](https://github.com/gogap/logrus_mate) | Logrus mate is a tool for Logrus to manage loggers, you can initial logger's level, hook and formatter by config file, the logger will be generated with different configs in different environments. | +| [Logrus Viper Helper](https://github.com/heirko/go-contrib/tree/master/logrusHelper) | An Helper around Logrus to wrap with spf13/Viper to load configuration with fangs! And to simplify Logrus configuration use some behavior of [Logrus Mate](https://github.com/gogap/logrus_mate). [sample](https://github.com/heirko/iris-contrib/blob/master/middleware/logrus-logger/example) | #### Testing Logrus has a built in facility for asserting the presence of log messages. This is implemented through the `test` hook and provides: -* decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just adds the `test` hook -* a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): +- decorators for existing logger (`test.NewLocal` and `test.NewGlobal`) which basically just adds the `test` hook +- a test logger (`test.NewNullLogger`) that just records log messages (and does not output any): ```go import( - "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/test" + "git.corp.kornet35.ru/gopkg/logrus" + "git.corp.kornet35.ru/gopkg/logrus/hooks/test" "github.com/stretchr/testify/assert" "testing" ) @@ -504,12 +513,10 @@ If you are sure such locking is not needed, you can call logger.SetNoLock() to d Situation when locking is not needed includes: -* You have no hooks registered, or hooks calling is already thread-safe. +- You have no hooks registered, or hooks calling is already thread-safe. * Writing to logger.Out is already thread-safe, for example: - - 1) logger.Out is protected by locks. - + 1. logger.Out is protected by locks. 2) logger.Out is an os.File handler opened with `O_APPEND` flag, and every write is smaller than 4k. (This allows multi-thread/multi-process writing) (Refer to http://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/) diff --git a/ci/go.mod b/ci/go.mod index e895e95..d6b3494 100644 --- a/ci/go.mod +++ b/ci/go.mod @@ -1,4 +1,4 @@ -module github.com/sirupsen/logrus/ci +module git.corp.kornet35.ru/gopkg/logrus/ci go 1.15 diff --git a/doc.go b/doc.go index da67aba..7ea3a5f 100644 --- a/doc.go +++ b/doc.go @@ -1,26 +1,30 @@ /* Package logrus is a structured logger for Go, completely API compatible with the standard library logger. - The simplest way to use Logrus is simply the package-level exported logger: - package main + package main - import ( - log "github.com/sirupsen/logrus" - ) + import ( + log "git.corp.kornet35.ru/gopkg/logrus" + ) - func main() { - log.WithFields(log.Fields{ - "animal": "walrus", - "number": 1, - "size": 10, - }).Info("A walrus appears") - } + func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "number": 1, + "size": 10, + }).Info("A walrus appears") + } Output: - time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 -For a full guide visit https://github.com/sirupsen/logrus + time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 + + time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 + + time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 + +For a full guide visit https://git.corp.kornet35.ru/gopkg/logrus */ package logrus diff --git a/example_basic_test.go b/example_basic_test.go index 9ff5655..a46698a 100644 --- a/example_basic_test.go +++ b/example_basic_test.go @@ -3,7 +3,7 @@ package logrus_test import ( "os" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) func Example_basic() { diff --git a/example_custom_caller_test.go b/example_custom_caller_test.go index 6749eff..44dd8cd 100644 --- a/example_custom_caller_test.go +++ b/example_custom_caller_test.go @@ -6,7 +6,7 @@ import ( "runtime" "strings" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) func ExampleJSONFormatter_CallerPrettyfier() { diff --git a/example_default_field_value_test.go b/example_default_field_value_test.go index e7edd1a..2c268b4 100644 --- a/example_default_field_value_test.go +++ b/example_default_field_value_test.go @@ -3,7 +3,7 @@ package logrus_test import ( "os" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) type DefaultFieldHook struct { diff --git a/example_function_test.go b/example_function_test.go index dda890d..be69ace 100644 --- a/example_function_test.go +++ b/example_function_test.go @@ -3,7 +3,7 @@ package logrus_test import ( "testing" - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" "github.com/stretchr/testify/assert" ) diff --git a/example_global_hook_test.go b/example_global_hook_test.go index ff7b255..b580370 100644 --- a/example_global_hook_test.go +++ b/example_global_hook_test.go @@ -3,7 +3,7 @@ package logrus_test import ( "os" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) var ( diff --git a/example_hook_test.go b/example_hook_test.go index dc0e69f..7ebb1c5 100644 --- a/example_hook_test.go +++ b/example_hook_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package logrus_test @@ -6,8 +7,8 @@ import ( "log/syslog" "os" - "github.com/sirupsen/logrus" - slhooks "github.com/sirupsen/logrus/hooks/syslog" + "git.corp.kornet35.ru/gopkg/logrus" + slhooks "git.corp.kornet35.ru/gopkg/logrus/hooks/syslog" ) // An example on how to use a hook diff --git a/go.mod b/go.mod index 8b3f6d3..49a2ddf 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/sirupsen/logrus +module git.corp.kornet35.ru/gopkg/logrus require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/hook_test.go b/hook_test.go index a2becc8..4af6481 100644 --- a/hook_test.go +++ b/hook_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/test" - . "github.com/sirupsen/logrus/internal/testutils" + . "git.corp.kornet35.ru/gopkg/logrus" + "git.corp.kornet35.ru/gopkg/logrus/hooks/test" + . "git.corp.kornet35.ru/gopkg/logrus/internal/testutils" ) type TestHook struct { diff --git a/hooks/syslog/README.md b/hooks/syslog/README.md index 67cb5ea..53d9a5a 100644 --- a/hooks/syslog/README.md +++ b/hooks/syslog/README.md @@ -5,8 +5,8 @@ ```go import ( "log/syslog" - "github.com/sirupsen/logrus" - lSyslog "github.com/sirupsen/logrus/hooks/syslog" + "git.corp.kornet35.ru/gopkg/logrus" + lSyslog "git.corp.kornet35.ru/gopkg/logrus/hooks/syslog" ) func main() { @@ -24,8 +24,8 @@ If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or " ```go import ( "log/syslog" - "github.com/sirupsen/logrus" - lSyslog "github.com/sirupsen/logrus/hooks/syslog" + "git.corp.kornet35.ru/gopkg/logrus" + lSyslog "git.corp.kornet35.ru/gopkg/logrus/hooks/syslog" ) func main() { @@ -54,8 +54,8 @@ package main import ( "log/syslog" - log "github.com/sirupsen/logrus" - logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" + log "git.corp.kornet35.ru/gopkg/logrus" + logrus_syslog "git.corp.kornet35.ru/gopkg/logrus/hooks/syslog" ) type customHook struct { diff --git a/hooks/syslog/syslog.go b/hooks/syslog/syslog.go index 02b8df3..fae7495 100644 --- a/hooks/syslog/syslog.go +++ b/hooks/syslog/syslog.go @@ -1,3 +1,4 @@ +//go:build !windows && !nacl && !plan9 // +build !windows,!nacl,!plan9 package syslog @@ -7,7 +8,7 @@ import ( "log/syslog" "os" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) // SyslogHook to send logs via syslog. diff --git a/hooks/syslog/syslog_test.go b/hooks/syslog/syslog_test.go index bec6efd..c87e678 100644 --- a/hooks/syslog/syslog_test.go +++ b/hooks/syslog/syslog_test.go @@ -1,3 +1,4 @@ +//go:build !windows && !nacl && !plan9 // +build !windows,!nacl,!plan9 package syslog @@ -6,7 +7,7 @@ import ( "log/syslog" "testing" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) func TestLocalhostAddAndPrint(t *testing.T) { diff --git a/hooks/test/test.go b/hooks/test/test.go index 046f0bf..b2069fc 100644 --- a/hooks/test/test.go +++ b/hooks/test/test.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "sync" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" ) // Hook is a hook designed for dealing with logs in test scenarios. diff --git a/hooks/test/test_test.go b/hooks/test/test_test.go index 9601491..00466c1 100644 --- a/hooks/test/test_test.go +++ b/hooks/test/test_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" "github.com/stretchr/testify/assert" ) diff --git a/hooks/writer/README.md b/hooks/writer/README.md index 6967630..436655e 100644 --- a/hooks/writer/README.md +++ b/hooks/writer/README.md @@ -5,7 +5,7 @@ Send logs of given levels to any object with `io.Writer` interface. ## Usage If you want for example send high level logs to `Stderr` and -logs of normal execution to `Stdout`, you could do it like this: +logs of normal execution to `Stdout`, you could do it like this: ```go package main @@ -14,8 +14,8 @@ import ( "io/ioutil" "os" - log "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/writer" + log "git.corp.kornet35.ru/gopkg/logrus" + "git.corp.kornet35.ru/gopkg/logrus/hooks/writer" ) func main() { diff --git a/hooks/writer/writer.go b/hooks/writer/writer.go index 1160c79..d6dc8e1 100644 --- a/hooks/writer/writer.go +++ b/hooks/writer/writer.go @@ -3,7 +3,7 @@ package writer import ( "io" - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" ) // Hook is a hook that writes logs of specified LogLevels to specified Writer diff --git a/hooks/writer/writer_test.go b/hooks/writer/writer_test.go index a30d3b0..94f10b7 100644 --- a/hooks/writer/writer_test.go +++ b/hooks/writer/writer_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - log "github.com/sirupsen/logrus" + log "git.corp.kornet35.ru/gopkg/logrus" "github.com/stretchr/testify/assert" ) diff --git a/internal/testutils/testutils.go b/internal/testutils/testutils.go index 6e3a620..268fbe1 100644 --- a/internal/testutils/testutils.go +++ b/internal/testutils/testutils.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - . "github.com/sirupsen/logrus" + . "git.corp.kornet35.ru/gopkg/logrus" "github.com/stretchr/testify/require" ) diff --git a/level_test.go b/level_test.go index 78915c4..4efa0eb 100644 --- a/level_test.go +++ b/level_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "testing" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" "github.com/stretchr/testify/require" ) diff --git a/logrus_test.go b/logrus_test.go index 72a02de..242eabe 100644 --- a/logrus_test.go +++ b/logrus_test.go @@ -15,8 +15,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/sirupsen/logrus" - . "github.com/sirupsen/logrus/internal/testutils" + . "git.corp.kornet35.ru/gopkg/logrus" + . "git.corp.kornet35.ru/gopkg/logrus/internal/testutils" ) // TestReportCaller verifies that when ReportCaller is set, the 'func' field @@ -40,7 +40,7 @@ func TestReportCallerWhenConfigured(t *testing.T) { assert.Equal(t, "testWithCaller", fields["msg"]) assert.Equal(t, "info", fields["level"]) assert.Equal(t, - "github.com/sirupsen/logrus_test.TestReportCallerWhenConfigured.func3", fields[FieldKeyFunc]) + "git.corp.kornet35.ru/gopkg/logrus_test.TestReportCallerWhenConfigured.func3", fields[FieldKeyFunc]) }) LogAndAssertJSON(t, func(log *Logger) { @@ -379,7 +379,7 @@ func TestNestedLoggingReportsCorrectCaller(t *testing.T) { assert.Equal(t, "looks delicious", fields["msg"]) assert.Equal(t, "eating raw fish", fields["context"]) assert.Equal(t, - "github.com/sirupsen/logrus_test.TestNestedLoggingReportsCorrectCaller", fields["func"]) + "git.corp.kornet35.ru/gopkg/logrus_test.TestNestedLoggingReportsCorrectCaller", fields["func"]) cwd, err := os.Getwd() require.NoError(t, err) assert.Equal(t, filepath.ToSlash(fmt.Sprintf("%s/logrus_test.go:%d", cwd, line-1)), filepath.ToSlash(fields["file"].(string))) @@ -410,7 +410,7 @@ func TestNestedLoggingReportsCorrectCaller(t *testing.T) { assert.Equal(t, "The hardest workin' man in show business", fields["msg"]) assert.Nil(t, fields["fields.msg"], "should not have prefixed previous `msg` entry") assert.Equal(t, - "github.com/sirupsen/logrus_test.TestNestedLoggingReportsCorrectCaller", fields["func"]) + "git.corp.kornet35.ru/gopkg/logrus_test.TestNestedLoggingReportsCorrectCaller", fields["func"]) require.NoError(t, err) assert.Equal(t, filepath.ToSlash(fmt.Sprintf("%s/logrus_test.go:%d", cwd, line-1)), filepath.ToSlash(fields["file"].(string))) diff --git a/writer_test.go b/writer_test.go index 5b6261b..c670659 100644 --- a/writer_test.go +++ b/writer_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" + "git.corp.kornet35.ru/gopkg/logrus" "github.com/stretchr/testify/assert" )