logasm 0.1.0 → 0.1.1

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: c1c109d32973a0fb0874162679d8c648790698ff
4
- data.tar.gz: 4187e98a866d2ec61e4232febb84a6832a30c019
3
+ metadata.gz: 200640bf85d51b2e5a0624792740b9a3b4282b32
4
+ data.tar.gz: f957214552bdbdb5a6b0875e6937156a593de3a7
5
5
  SHA512:
6
- metadata.gz: da9efd6daf3d43b27e7a16b25c1d858c8d85f19291823cb4d57ba58c86aef7376559a5ea7ce8a9629c54492a0aafafbb5b00487c0f6bf53bbdf993148ebd9244
7
- data.tar.gz: 0632bf09b2a4079a036ec8a53469b826a8e1a1a562972ed5300e48ce11babd1187cc5b9601bfdb811796c3c6d47d35fd666d1ef21001f325ac475ef9c65772b6
6
+ metadata.gz: 7d22edc2348903f4893b2f79dc8c34a34279280468d5c0ae96b5e3a6204cf0ca6b270929e2d80c61e2abda5705a019ac131769339741968d326002e110ed852d
7
+ data.tar.gz: 6f48d7208176093532f4d6773ea5488803099bad11ceb0e750248a0d0fa2d9b35bbc67322b80112ed816f96951ee427bc6c586bc9cfcfdaacb78b0f250124eef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- logasm (0.1.0)
4
+ logasm (0.1.1)
5
5
  inflecto
6
6
  logstash-event (~> 1.2)
7
7
 
@@ -6,7 +6,9 @@ class Logasm
6
6
  class LogstashAdapter
7
7
  attr_reader :logger
8
8
 
9
- def initialize(level, service, host:, port:, **)
9
+ def initialize(level, service, arguments = {})
10
+ host = arguments.fetch(:host)
11
+ port = arguments.fetch(:port)
10
12
  device = UDPSocket.new.tap do |socket|
11
13
  socket.connect(host, port)
12
14
  end
@@ -8,7 +8,9 @@ class Logasm
8
8
  @logger.level = level
9
9
  end
10
10
 
11
- def log(level, message: nil, **metadata)
11
+ def log(level, metadata = {})
12
+ message = metadata[:message]
13
+ metadata.delete(:message)
12
14
  log_data = [message, metadata.empty? ? nil : metadata.to_json].compact.join(' ')
13
15
 
14
16
  @logger.public_send level, log_data
data/logasm.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "logasm"
7
- gem.version = '0.1.0'
7
+ gem.version = '0.1.1'
8
8
  gem.authors = ["Salemove"]
9
9
  gem.email = ["support@salemove.com"]
10
10
  gem.description = %q{It's logasmic}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salemove
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-event