Commit Graph

264 Commits

Author SHA1 Message Date
Matt Bostock 7ba71bd357 Rework the Airbrake hook
Rework the Airbrake hook to:

a) change the interface so that the Airbrake credentials are stored in
an unexported struct, `airbrakeHook`, which is instantiated using the
`NewHook()` method

b) send log entries where no 'error' field is set to Airbrake, using the
`entry.Message` string as the message sent to Airbrake but continue to
allow the passing of error types using the 'error' field

Update the tests accordingly, assuring that the correct message is
received by the Airbrake server.

Also update the examples in the README, which would not have worked with
the previous implementation of the Airbrake hook.
2015-03-19 10:03:27 -04:00
Matt Bostock 4fcb55c734 Rename package from logrus_airbrake to airbrake
Using underscores in package names in discouraged:
https://golang.org/doc/effective_go.html#package-names

Given that this package is in a subdirectory of the logrus package,
the name `airbrake` should be sufficiently descriptive.
2015-03-19 10:03:27 -04:00
Simon Eskildsen 9cc13fab16 examples/basic: add debug level 2015-03-19 10:03:27 -04:00
Simon Eskildsen 566a97d868 json_formatter: add tests for field clashes and newline 2015-03-19 10:03:27 -04:00
Simon Eskildsen 0fa54be10f text_formatter: add field to disable sorting 2015-03-19 10:03:27 -04:00
Simon Eskildsen 0dd045932f json_formatter: always cast errors to strings
Fixes #137
2015-03-19 10:03:27 -04:00
Matt Bostock 31897e2db5 Remove misleading comment in Airbrake hook
As far as I can tell, exceptions are always sent regardless of what
`airbrake.Environment` is set to.
2015-03-19 10:03:27 -04:00
Matt Bostock e803eeed62 Add integration test to Airbrake hook
Add a test for the Airbrake hook to:

a) document how the hook is intended to work

b) test that an XML payload is received with the expected message
2015-03-19 10:03:27 -04:00
Henrik Hodne ff5ba169e8 text-formatter: do not quote 9 2015-03-19 10:03:26 -04:00
Nikolay Kirsh 9aea821200 fix Second const 2015-03-19 10:03:26 -04:00
Simon Eskildsen 5be851d706 text_formatter: improve comments 2015-03-19 10:03:26 -04:00
Steeve Lennmark 115ae7564e Add option to show full timestamp in TextFormatter
Sometimes elapsed seconds just aren't enough.
2015-03-19 10:03:26 -04:00
Lorenzo Villani 9c9013ac4f Change DebugLevel color to gray 2015-03-19 10:03:26 -04:00
Alexander Demidov 2ec723cd5b add logstash formatter test 2015-03-15 23:34:19 +06:00
Alexander Demidov 3cc6fcc521 use formatters directory 2015-03-05 23:31:39 +06:00
Alex Demidov 75cc3dd51a Update README.md 2015-02-20 21:02:11 +05:00
Alexander Demidov e15d51fef3 formatter for logstash (http://logstash.net) 2015-02-20 21:52:53 +06:00
Simon Eskildsen 6dcec6ed3b Merge pull request #127 from noxiouz/fix_datarace_GetLevel
[Race] Fix datarace in GetLevel
2015-02-19 19:52:08 -05:00
Anton Tiurin f08673d24a [Race] Fix datarace in GetLevel
`std.Level` is protected by mutex in setter (SetLevel),
so it must be protected in geetter (GetLevel) too.

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-02-20 01:14:10 +03:00
Simon Eskildsen 4d9b4f0c83 readme: add journal hook 2015-02-19 18:51:13 +00:00
Simon Eskildsen 273bd5984c Merge pull request #129 from noxiouz/speedup_text_formatter
[TextFormatter] Preallocate enough memory for keys to speedup
2015-02-17 12:42:44 -05:00
Anton Tiurin d1dfe8db73 [TextFormatter] Preallocate enough memory for keys to speedup.
Benchmarks:
 * BenchmarkSmallTextFormatter: 6140/5943 ~3%
 * BenchmarkLargeTextFormatter: 28050/24789 ~11%

Signed-off-by: Anton Tiurin <noxiouz@yandex.ru>
2015-02-17 19:08:32 +03:00
Simon Eskildsen 38a6ff9215 readme: add note on stability to avoid confusion 2015-02-12 17:48:35 +00:00
Simon Eskildsen 7f14e05c6c Merge pull request #126 from x1022as/master
fix typo
2015-02-10 12:38:07 -05:00
d00221763 6383fe40c5 fix typo
Signed-off-by: Deng Guangxing <denguangxing@huawei.com>
2015-02-10 16:49:34 +08:00
Simon Eskildsen 0b189e019a terminal: don't exclude appengine 2015-02-07 20:27:43 +00:00
Simon Eskildsen 467d9d55c2 Merge pull request #119 from Sirupsen/add-writer-to-readme
add an entry about writer in README
2015-02-03 15:19:37 -05:00
Antoine Grondin 896e5e5d4d add an entry about logger.Writer() in README 2015-01-31 14:08:25 -05:00
Simon Eskildsen 89efc1fea9 Merge pull request #103 from phemmer/writer_interface
add io.Writer interface compatability
2015-01-30 13:07:08 -05:00
Patrick Hemmer 51cbf81dde rename InputWriter -> Writer 2015-01-26 09:59:50 -05:00
Simon Eskildsen 539d4dc034 Merge pull request #117 from mattyw/patch-1
drive by fix to README.md
2015-01-23 12:37:18 -05:00
Matt Williams 2bc78c204b drive by fix to README.md 2015-01-23 01:57:51 +00:00
Simon Eskildsen 844911ce07 test: remove deprecated #len calls 2015-01-20 20:38:13 -05:00
Patrick Hemmer ed888975b3 close inputReader on error instead of using Fatal() 2015-01-20 10:22:30 -05:00
Antoine Grondin bdb64b3f9f Merge pull request #115 from rasky/go14
Add testing for go 1.4
2015-01-19 19:00:36 -05:00
Giovanni Bajo 0009c01b31 Simplify dep install 2015-01-18 02:19:28 +01:00
Giovanni Bajo 0e4c360cd8 Test with go 1.4 2015-01-18 02:06:44 +01:00
Simon Eskildsen 58f778a886 Revert "Merge pull request #100 from crquan/patch-1"
This reverts commit c6a969a0de, reversing
changes made to 3c5b048a9d.
2015-01-15 13:40:48 -05:00
Simon Eskildsen c6a969a0de Merge pull request #100 from crquan/patch-1
make sure no trailing spaces
2015-01-15 07:12:29 -05:00
Simon Eskildsen 3c5b048a9d Merge pull request #104 from freeformz/doc-fix
The format is logfmt, not l2met, although that is where it "originated"
2015-01-14 20:05:07 -05:00
Simon Eskildsen 35ade18898 Merge pull request #101 from vbatts/termios_openbsd
openbsd Termios
2015-01-14 18:31:36 -05:00
Simon Eskildsen 2f722357d3 Merge pull request #105 from phemmer/entry_warning
Add missing `(*Entry) Warning()` function
2015-01-14 18:30:43 -05:00
Patrick Hemmer e2dff63faa Add missing `(*Entry) Warning()` function 2015-01-12 17:20:11 -05:00
Patrick Hemmer 299ee95277 add io.Writer interface compatability 2015-01-12 03:24:19 -05:00
Edward Muller 8c09acde89 The format is logfmt, not l2met, although that is where it "originated" 2015-01-09 16:13:34 -08:00
Vincent Batts 97e951044c terminal: openbsd Termios
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2015-01-06 08:44:32 -05:00
Derek Che dcbe8d66af make sure no leading or trailing spaces
This changed printColored and printKeyValue to print in same way
with prefix space instead of trailing space, to make it easier
to slice out when returning in Format;
The test cases are to make sure msg formartting doesn't include
leading or trailing spaces;

Closes #99

Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-04 00:19:36 -08:00
Derek Che a243bbaa0b share common calling path in printKeyValue
Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-04 00:01:49 -08:00
Derek Che 03377c6168 rename f.appendKeyValue to printKeyValue
printKeyValue is working similar like printColored, not using
any fields of TextFormatter, should be a util func instead of
a method of TextFormatter.

Signed-off-by: Derek Che <drc@yahoo-inc.com>
2015-01-03 23:56:39 -08:00
Simon Eskildsen d2f9ffa1d9 readme: add slack hook
closes #98
2014-12-30 14:02:50 +01:00