logdna 0.0.2 → 0.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 +4 -4
- data/README.md +7 -11
- data/lib/logdna.rb +0 -4
- data/lib/logdna/version.rb +1 -1
- data/logdna.gemspec +3 -3
- metadata +3 -11
- data/lib/logdna/rails_logger.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db7ba5c409efbbabe822466d9b4d9349b2fb6a71
|
4
|
+
data.tar.gz: 7adca9e476db969193af213cda25cab8588e406c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 359d9ee08dc0999fe8d243c7cd64cb22a83083ecc83e102872b0eaef530e4cbb85a4e1576e743ec4f367fa2c366cd2e363c06f36018e6fd8103fa1e4909ea7d8
|
7
|
+
data.tar.gz: f969a6da9b9c76389546fefb05da5b4ee093e48981aa421d273fad4c94d598e6654e70cdf27b3d352458705307bc9f0ed2f716ca075995fc896162f61d175021
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
# Overview
|
18
18
|
|
19
|
-
This gem contains LogDNA::RubyLogger, an extension to the logger from Ruby's standard library
|
19
|
+
This gem contains LogDNA::RubyLogger, an extension to the logger from Ruby's standard library.
|
20
20
|
|
21
21
|
# Installation
|
22
22
|
|
@@ -36,9 +36,7 @@ Or install it yourself as:
|
|
36
36
|
|
37
37
|
# API
|
38
38
|
|
39
|
-
##
|
40
|
-
|
41
|
-
### ::new(api_key, hostname, options = {})
|
39
|
+
## ::new(api_key, hostname, options = {})
|
42
40
|
|
43
41
|
Instantiates a new instance of the class it is called on. api_key and hostname are required.
|
44
42
|
|
@@ -51,21 +49,19 @@ Options:
|
|
51
49
|
* mac: MAC address. Default: nil.
|
52
50
|
* ip: IP address. Default: nil.
|
53
51
|
|
54
|
-
|
52
|
+
## \#add
|
55
53
|
|
56
54
|
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.
|
57
55
|
|
58
|
-
|
56
|
+
## \#close_http
|
59
57
|
|
60
58
|
Close the HTTP connection to LogDNA's ingester.
|
61
59
|
|
62
|
-
|
60
|
+
## \#reopen_http
|
63
61
|
|
64
62
|
Open another HTTP connection to LogDNA's ingester if the connection is alread closed.
|
65
63
|
|
66
|
-
##
|
67
|
-
|
68
|
-
### \#<<(message)
|
64
|
+
## \#<<(message)
|
69
65
|
|
70
66
|
Dump given message to the log device without any formatting, then posts it to the LogDNA ingester. If no log device exists, return nil.
|
71
67
|
|
@@ -75,7 +71,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
75
71
|
|
76
72
|
# Contributing
|
77
73
|
|
78
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/logdna/
|
74
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/logdna/ruby.
|
79
75
|
|
80
76
|
# License
|
81
77
|
|
data/lib/logdna.rb
CHANGED
data/lib/logdna/version.rb
CHANGED
data/logdna.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'logdna/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'logdna'
|
8
8
|
spec.version = LogDNA::VERSION
|
9
|
-
spec.authors =
|
10
|
-
spec.email =
|
9
|
+
spec.authors = 'Edwin Lai'
|
10
|
+
spec.email = 'edwin@logdna.com'
|
11
11
|
|
12
12
|
spec.summary = 'LogDNA extension to ruby logger'
|
13
13
|
spec.homepage = 'https://github.com/logdna/logdna_ruby'
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'http', '~> 2.0'
|
23
|
+
spec.add_runtime_dependency 'http', '~> 2.0'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.13'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logdna
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Edwin Lai
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.0'
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 2.0.3
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '2.0'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 2.0.3
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: bundler
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,8 +81,7 @@ dependencies:
|
|
87
81
|
- !ruby/object:Gem::Version
|
88
82
|
version: '2.1'
|
89
83
|
description:
|
90
|
-
email:
|
91
|
-
- edwinlai@ucla.edu
|
84
|
+
email: edwin@logdna.com
|
92
85
|
executables: []
|
93
86
|
extensions: []
|
94
87
|
extra_rdoc_files: []
|
@@ -102,7 +95,6 @@ files:
|
|
102
95
|
- bin/console
|
103
96
|
- bin/setup
|
104
97
|
- lib/logdna.rb
|
105
|
-
- lib/logdna/rails_logger.rb
|
106
98
|
- lib/logdna/ruby_logger.rb
|
107
99
|
- lib/logdna/version.rb
|
108
100
|
- logdna.gemspec
|
data/lib/logdna/rails_logger.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'active_support/logger'
|
2
|
-
require 'http'
|
3
|
-
|
4
|
-
module LogDNA
|
5
|
-
class RailsLogger < ActiveSupport::Logger
|
6
|
-
include LogDNA
|
7
|
-
|
8
|
-
def initialize(api_key, hostname, options = {})
|
9
|
-
@conn = HTTP.persistent LogDNA::INGESTER_DOMAIN
|
10
|
-
opts = fill_opts_with_defaults(options)
|
11
|
-
super(opts[:logdev], opts[:shift_age], opts[:shift_size])
|
12
|
-
set_ivars(api_key, hostname, options)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|