logdna 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24d909c4d53e174a268e19648d08d0b801890dbd
4
- data.tar.gz: 35f91c6fb570116ade6040bb87ff5181ca18c1e7
3
+ metadata.gz: d05dff3833cf1ed480c1615bbb3688731ddd7102
4
+ data.tar.gz: d6a710439f8a994d03a3ac4cd83adb833f1e9764
5
5
  SHA512:
6
- metadata.gz: d833865aae127d9456c015f766240bfb016d15ca475089d3bec02b939c681a19ee7970b089429f24e06e8434aaf177e29290662823b0f8029782cbaa34b2857e
7
- data.tar.gz: b5177cee5a3515c8862f8c065706f6d8889e5794b084212b107bcff7834de4336a11f5a265bbbd1974098db5311b4b9cd881555e7c71663d7995df60ef27c57d
6
+ metadata.gz: 9508cda24a1b9c00afbc3520cf665760bf1c1470495ef54c830d4cd6b9a4f5cdca31efc06e0cbdacc8592a4b5e25e6e89a49b450d945514a4ec76d6535842dda
7
+ data.tar.gz: 5b992d86ba77019c1ab805631cefe8c859ea22768d7cb4a7de4ac2397c5de296c7913e70ec5d560945188a327dffd05b826a9954114008b0298faa68778f1471
data/README.md CHANGED
@@ -81,14 +81,14 @@ Options:
81
81
 
82
82
  __Make sure that the following options are numbers if you supply them. We are not responsible for any type errors if you enter non-numerical values for these options.__
83
83
 
84
- * shift_age: Number of old log files to keep, or frequency of rotation (daily, weekly, or monthly). Default: 7.
84
+ * shift_age: Number of old log files to keep, or frequency of rotation (daily, weekly, or monthly). Default: 7
85
85
  * shift_size: Maximum logfile size (only applies when shift_age is a number). Default: 1,048,576
86
86
  * buffer_max_size: Maximum number of lines in buffer. Default: 10
87
87
  * buffer_timeout: Frequency of posting requests to LogDNA. Default: 10 (seconds)
88
88
 
89
89
  ## \#add(severity, message=nil, progname=nil) {...}
90
90
 
91
- Log a message if the given severity is high enough and post it to the LogDNA ingester. This is the generic logging method. Users will be more inclined to use debug, info, warn, error, and fatal (which all call \#add), as [described in the Ruby Logger documentation](https://ruby-doc.org/stdlib-2.3.0/libdoc/logger/rdoc/Logger.html). Note that these methods take a source as the argument and a block which returns a message. It returns the http response.
91
+ Log a message if the given severity is high enough and post it to the LogDNA ingester. This is the generic logging method. Users will be more inclined to use debug, info, warn, error, and fatal (which all call \#add), as [described in the Ruby Logger documentation](https://ruby-doc.org/stdlib-2.3.0/libdoc/logger/rdoc/Logger.html). Note that these methods take a source as the argument and a block which returns a message, or a string/exception as an argument without a block. It returns the http response.
92
92
 
93
93
  ## \#close_http
94
94
 
data/lib/logdna.rb CHANGED
@@ -17,8 +17,12 @@ module LogDNA
17
17
  def add(severity, message = nil, progname = nil)
18
18
  super
19
19
  return true if severity < @level
20
- message ||= yield
21
- push_to_buffer(message, severity, progname) if @open
20
+ # Ruby Logger's author is a maniac.
21
+ # The reassignment in the library is gratuitous.
22
+ message ||= yield if block_given?
23
+ message, progname = progname, message unless message && block_given?
24
+ return unless @open
25
+ push_to_buffer(message, severity, progname)
22
26
  end
23
27
 
24
28
  def close_http
@@ -1,3 +1,3 @@
1
1
  module LogDNA
2
- VERSION = '0.0.5'.freeze
2
+ VERSION = '0.0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logdna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edwin Lai