oml4r 2.10.2 → 2.10.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/oml4r/logging/oml4r_appender.rb +19 -8
- data/lib/oml4r/version.rb +2 -2
- metadata +11 -9
- checksums.yaml +0 -7
@@ -1,24 +1,25 @@
|
|
1
1
|
require 'logging'
|
2
2
|
require 'oml4r'
|
3
|
+
require 'time'
|
3
4
|
|
4
5
|
module Logging::Appenders
|
5
6
|
|
6
7
|
def self.oml4r *args
|
7
8
|
return Logging::Appenders::Oml4r if args.empty?
|
8
|
-
Logging::Appenders::Oml4r.new
|
9
|
+
Logging::Appenders::Oml4r.new(*args)
|
9
10
|
end
|
10
11
|
|
11
12
|
class Oml4r < Logging::Appender
|
12
13
|
|
13
14
|
class LogMP < OML4R::MPBase
|
14
|
-
name :
|
15
|
+
name :log
|
16
|
+
param :time, :type => :string
|
17
|
+
param :level, :type => :int32
|
18
|
+
param :logger, :type => :string
|
15
19
|
param :data, :type => :string
|
16
20
|
param :file, :type => :string
|
17
|
-
param :
|
18
|
-
param :line, :type => :string
|
19
|
-
param :logger, :type => :string
|
21
|
+
param :line, :type => :int32
|
20
22
|
param :method, :type => :string
|
21
|
-
param :time, :type => :string
|
22
23
|
end
|
23
24
|
|
24
25
|
# pass a name and the usual OML options here to configure oml4r
|
@@ -32,6 +33,7 @@ module Logging::Appenders
|
|
32
33
|
$stderr.puts mex
|
33
34
|
exit
|
34
35
|
end
|
36
|
+
@inject_failed = false
|
35
37
|
end
|
36
38
|
|
37
39
|
def close *args
|
@@ -42,9 +44,18 @@ module Logging::Appenders
|
|
42
44
|
private
|
43
45
|
|
44
46
|
def write(event)
|
45
|
-
|
47
|
+
begin
|
48
|
+
LogMP.inject(event.time.iso8601, event.level.to_i, event.logger,
|
49
|
+
event.data, event.file, event.line.to_i, event.method)
|
50
|
+
rescue => ex
|
51
|
+
# Complain only once
|
52
|
+
unless @inject_failed
|
53
|
+
$stderr.puts "ERROR: While sending logging message via OML4r - #{mex}"
|
54
|
+
@inject_failed = true
|
55
|
+
end
|
56
|
+
end
|
46
57
|
self
|
47
58
|
end
|
48
59
|
|
49
60
|
end # class Oml4r
|
50
|
-
end # module
|
61
|
+
end # module
|
data/lib/oml4r/version.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
# Copyright (c) 2009 -
|
1
|
+
# Copyright (c) 2009 - 2014 National ICT Australia Limited (NICTA).
|
2
2
|
# This software may be used and distributed solely under the terms of the MIT license (License).
|
3
3
|
# You should find a copy of the License in LICENSE.TXT or at http://opensource.org/licenses/MIT.
|
4
4
|
# By downloading or using this software you accept the terms and the liability disclaimer in the License.
|
5
5
|
# ------------------
|
6
6
|
|
7
7
|
module OML4R
|
8
|
-
VERSION = "2.10.
|
8
|
+
VERSION = "2.10.3"
|
9
9
|
VERSION_STRING = "OML4R Client V#{VERSION}"
|
10
10
|
COPYRIGHT = "Copyright 2009-2014, NICTA"
|
11
11
|
end
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oml4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.10.
|
4
|
+
version: 2.10.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- NICTA
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-16 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
|
-
description: '["Simple OML client library and applications for Ruby"]'
|
14
|
+
description: ! '["Simple OML client library and applications for Ruby"]'
|
14
15
|
email:
|
15
16
|
- oml-user@lists.nicta.com.au
|
16
17
|
executables:
|
@@ -60,27 +61,28 @@ files:
|
|
60
61
|
homepage: http://oml.mytestbed.net
|
61
62
|
licenses:
|
62
63
|
- MIT
|
63
|
-
metadata: {}
|
64
64
|
post_install_message:
|
65
65
|
rdoc_options: []
|
66
66
|
require_paths:
|
67
67
|
- lib
|
68
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
69
70
|
requirements:
|
70
|
-
- - '>='
|
71
|
+
- - ! '>='
|
71
72
|
- !ruby/object:Gem::Version
|
72
73
|
version: '1.9'
|
73
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
74
76
|
requirements:
|
75
|
-
- - '>='
|
77
|
+
- - ! '>='
|
76
78
|
- !ruby/object:Gem::Version
|
77
79
|
version: '0'
|
78
80
|
requirements: []
|
79
81
|
rubyforge_project:
|
80
|
-
rubygems_version:
|
82
|
+
rubygems_version: 1.8.23
|
81
83
|
signing_key:
|
82
|
-
specification_version:
|
83
|
-
summary: '["This is a simple client library for OML which does not use liboml2 and
|
84
|
+
specification_version: 3
|
85
|
+
summary: ! '["This is a simple client library for OML which does not use liboml2 and
|
84
86
|
its filters, but connects directly to the server using the +text+ protocol. User
|
85
87
|
can use this library to create ruby applications which can send measurement to the
|
86
88
|
OML collection server. The gem ships with some example applications."]'
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: ac0d927de25844aef4430946426fd21fb2996301
|
4
|
-
data.tar.gz: 869927e388d2c20e5533522cb3d041cf905637bf
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: cfbe00962c39cfcf23a05dff15a1f7c43868851783aa75702a88e351d9b259ab5bc4bb72e824cd5d07019abf5243ed251824563c44856141d92e578d276d5605
|
7
|
-
data.tar.gz: 2170da7ed5cb58fd6b0c2312aabffcfa2aa9dd7a8648810e3b64c7107f25ec2c91f03b4161759d54d42e1e3b91e227eaa365ed0da9e68fb305d9f3c7b434cce5
|