1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

20 Commits

Author SHA1 Message Date
0967593010 Perform actions on flows asynchronously by default
Each flow now has an associated executor which performs all actions
(writing events, closing, reopening) asynchronously by default using a
Concurrent::SingleThreadExecutor.

This improves the responsiveness of the application by performing the
(usually) IO-bound task of writing the logs to a background thread.

By creating a flow with `synchronous: true`, all actions are run in the
calling thread as before, making the flow blocking.
2018-12-05 18:51:29 +01:00
dab393ee21 Disable moneky patching with RSpec 2018-02-15 16:03:13 +01:00
aa37d47b8f Singularize the Adapter and Encoder modules
Since we are using single objects from these namespaces, they are much
more suitable to be named in singular than in plural.
2017-10-20 22:27:50 +02:00
b6d15a8da7 Extract resolving of severity values to Rackstash.severity 2017-10-05 21:17:32 +02:00
59c94a8ecc Insert newline comment below magic comments in ruby file header 2017-09-29 17:15:07 +02:00
74242caf0b There can be only one... UNDEFINED
By ensuring that we only ever create a single UNDEFINED object from the
UndefinedClass, it behaves more like nil
2017-09-07 21:18:03 +02:00
168e62b63c Remove useless newlines 2017-08-12 14:02:03 +02:00
b228494d14 Raise a custom Rackstash::NotImplementedHereError instead of NotImplementedError
Using the core `NotInmplementedError` is not desireable since its
documentation includes:

> Note that if `fork` raises a `NotImplementedError`, then
> `respond_to?(:fork)` returns `false`.

Since we are responding to the method but still raise an error, our
usage of the exception does not fulfill its documentation.

A custom error instead of a default `NoMethodError` is still desireable
since it significantly helps with debugging. With a different Exception,
we make it clear that a method is expected to be there and just wasn't
implemented by a subclass as opposed to the caller just using an object
wrong and calling entirely unexpected methods on it.
2017-08-01 12:28:58 +02:00
c4f0b9cdeb Use an error_flow to log any exceptions during logging
During normal operation, the Flows will rescue all exceptions and log
them to the special error_flow. By default, we will write JSON logs to
STDERR.

The log location and format can either be change globally by setting (or
changing) the Rackstash.error_flow or for each Flow for a Logger
individually by setting Flow#error_flow.
2017-07-28 02:16:31 +02:00
dc3d2b20bf Add tests and clarify edge-case for Rackstash.severity_label 2017-07-18 23:28:26 +02:00
a4a6b248cf Use frozen string literals throughout the codebase in Ruby >= 2.3 2017-07-17 13:35:24 +02:00
1da5ae4a38 Extract unrelated constant tests 2017-07-15 14:32:09 +02:00
d07a9452f4 Add Rackstash::UNDEFINED constant
The {UNDEFINED} object can be used as the default value for method
arguments to distinguish it from `nil`. See
https://holgerjust.de/2016/detecting-default-arguments-in-ruby/#special-default-value
for details.
2017-07-11 23:42:13 +02:00
6958b8f509 Add Rubocop config and resolve most style issues 2017-02-16 22:47:17 +01:00
d489b6e26a Ensure Rackstash::FIELD_* constants are frozen strings 2017-02-05 21:18:32 +01:00
407b52120a Add basic fields to hold additional data on Buffers
The fields follow the basic structure of basic Hashes and Arrays but
provide an interface better suitable for us. Specifically:

* They check and enforce the datatypes for keys and values to be
  strictly JSON-conforming. Only the basic data-types are accepted
  respectively converted to.
* Hashes only accept String keys.
* Basic values are always frozen.
2017-02-02 15:04:02 +01:00
3081b03db1 Add basic logger structure with early spikes
The Rackstash::Logger class will server as the public main entry point
for users. It will eventually implement the mostly complete interface of
Ruby's Logger.

The idea of Rackstash is the we will allow to buffer multiple log
messages allong with additional data until a combined log event is
eventually flushed to an underlying log target. This allows to keep
connected log messages and data as a single unit from the start without
having to painstakingly parse and connect these in later systems again.
2017-01-18 23:34:55 +01:00
5dc6af0220 Add more useful version specification. 2017-01-16 00:28:06 +01:00
750da262b7 Add license headers to all code files 2017-01-15 18:38:33 +01:00
7e937904c0 Create inititial gem structure for rackstash
bundle gem --exe --coc --mit --test=rspec rackstash
2017-01-15 18:38:33 +01:00