ocean-rails 1.14.2 → 1.14.3

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: 3915eb13289c59b8d46a29dd86e05135d318677d
4
- data.tar.gz: 24fe6384132bc912908873d503c5de870ada8f46
3
+ metadata.gz: b7f957055559e368f6cb0c7c449f46b957c68076
4
+ data.tar.gz: 9cb3d11b49d425bc45bd229929d46b43361e7f18
5
5
  SHA512:
6
- metadata.gz: bceea4c882f79accc91905b0e330ea122e03c282ada6ce7997dffce61dc5d9866df1c33b8e2ce50a98afd7da8d040f22cac03451fe6b47d1c79f263965401648
7
- data.tar.gz: 5623d6b9394e554ef888d13675291730cec4bb6de9b372bd5f569a92cd20ac1ba8006af0d7e47a6f2d50511e316c703b5206d0bbc80d968b8d45632d426613f0
6
+ metadata.gz: 0091f80cdf13da6d98ae0aa052de5eac75946e7569256242b72ad2a59ec442d89c3613e81ccc175fca80390944cdfb598b70f1757e069860772d50bbe4ffcb63
7
+ data.tar.gz: cb1f8e078078690ee7c88d4e662e3477128a451d84d9b32d5485b56c817b5bdf20d208cd2d2e66973c412aae0b9daf3af5bc40ff120dfcd0b2a0d70dfc4e0236
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "1.14.2"
2
+ VERSION = "1.14.3"
3
3
  end
@@ -1,10 +1,21 @@
1
1
  require 'socket'
2
2
 
3
+ #
4
+ # This class is a drop-in replacement for the standard Rails logger. It is
5
+ # used in production only and uses ZeroMQ as an intelligent, high-capacity
6
+ # transport. ZeromqLogger implements enough of the Logger interface to allow
7
+ # it to override the standard logger.
8
+ #
3
9
  class ZeromqLogger
4
10
 
5
11
  attr_accessor :level, :log_tags
6
12
 
7
13
 
14
+ #
15
+ # Obtains the IP of the current process, initialises the @logger object
16
+ # by instantiating a ZeroLog object which then is used to set up the
17
+ # log data sender.
18
+ #
8
19
  def initialize
9
20
  super
10
21
  # Get info about our environment
@@ -14,14 +25,50 @@ class ZeromqLogger
14
25
  @logger.init_log_data_sender "/tmp/sub_push_#{Process.pid}"
15
26
  end
16
27
 
17
-
28
+ #
29
+ # Utility function which returns true if the current log level is +DEBUG+ or lower.
30
+ #
18
31
  def debug?() @level <= 0; end
32
+
33
+ #
34
+ # Utility function which returns true if the current log level is +INFO+ or lower.
35
+ #
19
36
  def info?() @level <= 1; end
37
+
38
+ #
39
+ # Utility function which returns true if the current log level is +WARN+ or lower.
40
+ #
20
41
  def warn?() @level <= 2; end
42
+
43
+ #
44
+ # Utility function which returns true if the current log level is +ERROR+ or lower.
45
+ #
21
46
  def error?() @level <= 3; end
47
+
48
+ #
49
+ # Utility function which returns true if the current log level is +FATAL+ or lower.
50
+ #
22
51
  def fatal?() @level <= 4; end
23
52
 
24
53
 
54
+ #
55
+ # This is the core method to add new log messages to the Rails log. It does nothing
56
+ # if the level of the message is lower than the current log level, or if the message
57
+ # is blank. Otherwise it creates a JSON log message as a hash, with data for the
58
+ # following keys:
59
+ #
60
+ # +timestamp+: The time in milliseconds since the start of the Unix epoch.
61
+ #
62
+ # +ip+: The IP of the logging entity.
63
+ #
64
+ # +pid+: The Process ID of the logging process.
65
+ #
66
+ # +service+: The name of the service.
67
+ #
68
+ # +level+: The log level of the message (0=debug, 1=info, 2=warn, etc).
69
+ #
70
+ # +msg+: The log message itself.
71
+ #
25
72
  def add(level, msg, progname)
26
73
  return true if level < @level
27
74
  msg = progname if msg.blank?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.2
4
+ version: 1.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson