Commit Graph

876 Commits

Author SHA1 Message Date
Simon Eskildsen 347abac2ab Merge pull request #149 from alphagov/improve_airbrake_hook
[#76800642] Rework the Airbrake hook
2015-03-19 09:56:24 -04:00
Burke Libbey 83752ed3c5
hooks: Add BugSnag hook 2015-03-16 15:34:10 -04:00
Alexander Demidov 2ec723cd5b add logstash formatter test 2015-03-15 23:34:19 +06:00
Matt Bostock ecc16b3b2a Remove outdated version of Airbrake hook
It seems unnecessary to duplicate the code (which is now outdated) in
the README. Instead, link to the built-in hooks where a user can see
the code.
2015-03-15 16:26:24 +00:00
Matt Bostock 83a820d91e 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-15 16:26:24 +00:00
Matt Bostock 78dee3c0ba 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-10 17:45:12 +00:00
Anton Tiurin a8b793a1fc gofmt 2015-03-10 19:06:14 +03:00
Anton Tiurin 98fd21de2c [JSON] Use type-switch for error field 2015-03-10 19:04:57 +03:00
Anton Tiurin 7498110889 Remove unused regexp 2015-03-10 18:56:16 +03:00
Antoine Grondin 2cea0f0d14 Merge pull request #145 from alphagov/add_tests_to_airbrake_hook
Add integration test to Airbrake hook
2015-03-09 11:58:39 -04:00
Simon Eskildsen 79d043289e examples/basic: add debug level 2015-03-09 15:40:44 +00:00
Simon Eskildsen bbf1b22f08 Merge pull request #131 from lvillani/debuglevel-gray
Change DebugLevel color to gray
2015-03-09 11:39:16 -04:00
Simon Eskildsen ab83faccde json_formatter: add tests for field clashes and newline 2015-03-09 15:30:43 +00:00
Simon Eskildsen 538395b333 text_formatter: add field to disable sorting 2015-03-09 15:19:51 +00:00
Simon Eskildsen 8287db7934 json_formatter: always cast errors to strings
Fixes #137
2015-03-09 15:15:08 +00:00
Antoine Grondin 53adda1d3e Merge pull request #147 from mattbostock/remove_misleading_comment
Remove misleading comment in Airbrake hook
2015-03-06 17:22:14 -05:00
Matt Bostock 8ba09b1c21 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-06 16:32:18 +00:00
Matt Bostock 26ea5be9c3 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-06 16:18:47 +00:00
Alexander Demidov 3cc6fcc521 use formatters directory 2015-03-05 23:31:39 +06:00
Simon Eskildsen a020ac2471 Merge pull request #143 from henrikhodne/do-not-quote-9
Text formatter: Do not quote 9
2015-03-04 10:45:58 -05:00
Henrik Hodne cd4266df0e text-formatter: do not quote 9 2015-03-04 14:04:50 +00:00
Simon Eskildsen eb84da520d Merge pull request #140 from xboston/patch-1
fix Second const
2015-03-02 07:28:43 -05:00
Nikolay Kirsh c810928262 fix Second const 2015-03-02 16:25:19 +05:00
Simon Eskildsen c0f7e35ed2 text_formatter: improve comments 2015-02-25 19:01:02 +00:00
Simon Eskildsen b0279da492 Merge pull request #134 from steevel/master
Add option to show full timestamp in TextFormatter
2015-02-25 13:59:30 -05:00
Steeve Lennmark ccaf6983d9 Add option to show full timestamp in TextFormatter
Sometimes elapsed seconds just aren't enough.
2015-02-20 18:43:24 +02: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
Lorenzo Villani 4fbdf5948e Change DebugLevel color to gray 2015-02-20 16:32:47 +01: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