logdna 0.0.5 → 0.0.6
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 +4 -4
- data/README.md +2 -2
- data/lib/logdna.rb +6 -2
- data/lib/logdna/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d05dff3833cf1ed480c1615bbb3688731ddd7102
|
4
|
+
data.tar.gz: d6a710439f8a994d03a3ac4cd83adb833f1e9764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
21
|
-
|
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
|
data/lib/logdna/version.rb
CHANGED