timberio 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5a2f951ecceb005b1ad5298962aaf33f78095aa
4
- data.tar.gz: 88359ccfc0697431e1ed5739090dbb1e737df25e
3
+ metadata.gz: 9e9463fc2083482f241bbe9f87bc3d50aec6cb10
4
+ data.tar.gz: 2ea0cb35a47c3854b235db761b4e54091779e0cf
5
5
  SHA512:
6
- metadata.gz: 5eec11448e4d4c7c12e2d0b997087d650022922b11c079e79ec615ff04c824b09c046399eb3e852c41b04d125fe0af6860dedd8982f23852e52dba1f92838325
7
- data.tar.gz: 9cb61772c8c75ba6d95134deff15e034184ec4c1d4bae0f35cbe41821d69c2176282d562b59b7fe78d989032ec128c5c33cabb9ee359c8373a847426994fbd1e
6
+ metadata.gz: 2e60262ff12446fd9054fd3903273a13602a94dd994b5d5e7c51d6ab554ba169b0e0b786a30af64ea3e1039538ba60269ef276be28d05528aa2965026d6d6ffe
7
+ data.tar.gz: edc32d438d1b37858de0f2a862261179767d33a280dac86f713372ff7332edaf3c0db34e103a30ebdb0a093c7157971b9e7524bc6f95e873a2f782a9a37d1c70
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Timber
2
2
 
3
3
  <p align="center" style="background: #140f2a;">
4
- <a href="http://github.com/timberio/timber-ruby"><img src="http://files.timber.io/images/ruby-library-readme-header.gif" height="370" /></a>
4
+ <a href="http://github.com/timberio/timber-ruby"><img src="http://files.timber.io/images/ruby-library-readme-header.gif" height="469" /></a>
5
5
  </p>
6
6
 
7
7
  [![CircleCI](https://circleci.com/gh/timberio/timber-ruby.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/timberio/timber-ruby/tree/master)
@@ -11,16 +11,15 @@
11
11
 
12
12
 
13
13
  1. [What is timber?](#what-is-timber)
14
- 2. [Examples](#examples)
15
- 3. [Pricing](#pricing)
14
+ 2. [Logger Examples](#logger-examples)
15
+ 3. [Console Pricing](#console-pricing)
16
16
  2. [Install](#install)
17
17
 
18
18
 
19
19
  ## What is Timber?
20
20
 
21
- Glad you asked :) Timber tames the crazy world that is logging. First, it *automatically*
22
- augments your logs with structured data. Second, it provides a transparent, no lock-in, API
23
- for logging your own events. Lastly, it can be paired with a [simple modern console](https://timber.io) for querying.
21
+ Glad you asked! :) Timber turns your messy string logs into structured events with context where
22
+ it can optionally be paired with our [simple modern console](https://timber.io) for querying.
24
23
 
25
24
  For example, it automatically turns this:
26
25
 
@@ -69,7 +68,7 @@ This enables you to query your logs in a way that
69
68
  4. `level:warn` - Log levels in your logs. Imagine that!
70
69
 
71
70
 
72
- ## Examples
71
+ ## Logger Examples
73
72
 
74
73
  > Another service? More lock-in? More code debt? More sadness? :*(
75
74
 
@@ -128,18 +127,18 @@ My Application |--[STDOUT]--> logs ---> Timber ---> |-- new relic / etc
128
127
  ```
129
128
 
130
129
 
131
- ## Pricing
130
+ ## Console Pricing
132
131
 
133
132
  > This is all gravy, but wouldn't it get expensive?
134
133
 
135
134
  If you opt to send your data to the [Timber service](https://timber.io), we only charge for
136
135
  the size of the `message`, `dt`, and `event.custom` attributes. Everything else is
137
136
  stored at no cost to you. [Say wha?!](http://i.giphy.com/l0HlL2vlfpWI0meJi.gif). This ensures
138
- pricing remains predictable. And our pricing is simple, we charge per GB transferred to us and
139
- retained, no user limits, and no weird feature matrixes. Lastly, the data is yours, in a simple
140
- non-proprietary JSON format.
137
+ pricing remains predictable and simple. We charge per GB transferred to us and
138
+ retained, no user limits, and no weird feature matrixes. Finally, the data is yours, in a simple
139
+ non-proprietary JSON format that you can export to S3, Redshift, or any of our other integrations.
141
140
 
142
- For more details checkout our [timber.io](https://timber.io).
141
+ For more details checkout out [timber.io](https://timber.io).
143
142
 
144
143
  ## Install
145
144
 
@@ -147,7 +146,7 @@ For more details checkout our [timber.io](https://timber.io).
147
146
 
148
147
  ```ruby
149
148
  # Gemfile
150
- gem 'timberio', require: "timber"
149
+ gem 'timberio'
151
150
  ```
152
151
 
153
152
  ### 2. Install the logger:
data/circle.yml CHANGED
@@ -10,12 +10,10 @@ dependencies:
10
10
  - PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH rvm-exec 1.9.3 appraisal rails-3.0.X bundle install
11
11
  - PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH rvm-exec 1.9.3 appraisal rails-3.1.X bundle install
12
12
  - PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH rvm-exec 1.9.3 appraisal rails-3.2.X bundle install
13
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 bundle install
14
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-4.0.X bundle install
15
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-4.1.X bundle install
16
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-4.2.X bundle install
17
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-5.0.X bundle install
18
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-edge bundle install
13
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 bundle install
14
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 appraisal install
15
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 bundle install
16
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 appraisal install
19
17
 
20
18
  test:
21
19
  override:
@@ -23,8 +21,13 @@ test:
23
21
  - PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH rvm-exec 1.9.3 appraisal rails-3.0.X rspec
24
22
  - PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH rvm-exec 1.9.3 appraisal rails-3.1.X rspec
25
23
  - PATH=/home/ubuntu/.rvm/gems/ruby-1.9.3-p448/bin:$PATH rvm-exec 1.9.3 appraisal rails-3.2.X rspec
26
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-4.0.X rspec
27
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-4.1.X rspec
28
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-4.2.X rspec
29
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-5.0.X rspec
30
- - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.0/bin:$PATH rvm-exec 2.3.0 appraisal rails-edge rspec
24
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 appraisal rails-4.0.X rspec
25
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 appraisal rails-4.1.X rspec
26
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 appraisal rails-4.2.X rspec
27
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 appraisal rails-5.0.X rspec
28
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.2.6/bin:$PATH rvm-exec 2.2.6 appraisal rails-edge rspec
29
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 appraisal rails-4.0.X rspec
30
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 appraisal rails-4.1.X rspec
31
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 appraisal rails-4.2.X rspec
32
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 appraisal rails-5.0.X rspec
33
+ - PATH=/home/ubuntu/.rvm/gems/ruby-2.3.3/bin:$PATH rvm-exec 2.3.3 appraisal rails-edge rspec
data/lib/timber/logger.rb CHANGED
@@ -114,8 +114,7 @@ module Timber
114
114
  log_entry = build_log_entry(severity, time, progname, msg)
115
115
  metadata = log_entry.to_json(:except => [:message])
116
116
  # use << for concatenation for performance reasons
117
- puts msg
118
- log_entry.message << " " << METADATA_CALLOUT << " " << metadata << "\n"
117
+ log_entry.message.gsub("\n", "\\n") << " " << METADATA_CALLOUT << " " << metadata << "\n"
119
118
  end
120
119
  end
121
120
 
@@ -11,7 +11,6 @@ module Timber
11
11
  private
12
12
  def log_error(request, wrapper)
13
13
  logger = logger(request)
14
- puts logger.inspect
15
14
  return unless logger
16
15
 
17
16
  exception = wrapper.exception
@@ -1,3 +1,3 @@
1
1
  module Timber
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -54,6 +54,11 @@ describe Timber::Logger, :rails_23 => true do
54
54
  end
55
55
  expect(io.string).to eq("payment rejected @timber.io {\"level\":\"info\",\"dt\":\"2016-09-01T12:00:00.000000Z\",\"event\":{\"custom\":{\"payment_rejected\":{\"customer_id\":\"abcde1234\",\"amount\":100}}}}\n")
56
56
  end
57
+
58
+ it "should escape new lines" do
59
+ logger.info "first\nsecond"
60
+ expect(io.string).to eq("first\\nsecond @timber.io {\"level\":\"info\",\"dt\":\"2016-09-01T12:00:00.000000Z\"}\n")
61
+ end
57
62
  end
58
63
 
59
64
  context "with the :json format" do
@@ -37,7 +37,7 @@ describe Timber::Probes::ActionDispatchDebugExceptions do
37
37
  mock_class
38
38
  dispatch_rails_request("/exception")
39
39
  # Because constantly updating the line numbers sucks :/
40
- expect(io.string).to include("RuntimeError (boom):\n\n")
40
+ expect(io.string).to include("RuntimeError (boom):\\n\\n")
41
41
  expect(io.string).to include("@timber.io")
42
42
  expect(io.string).to include("\"event\":{\"exception\":{\"name\":\"RuntimeError\",\"message\":\"boom\",\"backtrace\":[\"")
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timberio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timber Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-12 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack