lib/timber/contexts/custom.rb in timber-1.0.3 vs lib/timber/contexts/custom.rb in timber-1.0.4
- old
+ new
@@ -6,18 +6,16 @@
# custom_context = Timber::Contexts::Custom.new(type: :keyspace, data: %{my: "data"})
# Timber::CurrentContext.with(custom_context) do
# # ... anything logged here will have the context ...
# end
class Custom < Context
+ @keyspace = :custom
+
attr_reader :type, :data
def initialize(attributes)
@type = attributes[:type] || raise(ArgumentError.new(":type is required"))
@data = attributes[:data] || raise(ArgumentError.new(":data is required"))
- end
-
- def keyspace
- :custom
end
def as_json(_options = {})
{type => data}
end
\ No newline at end of file