simple_cloud_logging 1.1.17 → 1.1.22

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: d63c7caf567034c39000aa172f2cb68257c5d3f0
4
- data.tar.gz: a678ebbe28b5f6e54816593d8526e9d0aa407d0d
3
+ metadata.gz: b55227bd081e105b77e298e3daac60ace0f5d371
4
+ data.tar.gz: 49c9b0d4ff61a751157cb3ab75aed3f1019e36c4
5
5
  SHA512:
6
- metadata.gz: 76c9b625c1b7d0a9e94c768eb3320fe4ddbe35be5118ab552c6d39b0e80bddbf04ea36e70e9a2fe1045336aeb72c452e67cf7df7f2d88bee6e34848269f89e34
7
- data.tar.gz: 86a28cce82ddb896a2572ef6de704386670ee500fe9f9761b9dc75d6f9be42c64ed3fbd30f2697e2f055a6e4809a0de6c82f292a10d809cbd1152c95b4eb5003
6
+ metadata.gz: eaca7bc0ed8363f0a8d7b930125fc8ecf2ace1b61dee936e56335136206a7074024811e278d98031fc247da6ba7c3c884fc9b4efa09adcf5dee41a9085b73eca
7
+ data.tar.gz: d25f6b90989b5fe1575dfa6d3c4056240dd63b60e79c0563849bbf4150e1ad43a0857ec4e47f9472ec204faa6796a23223e8053b56b8a2a836108191c4c49d0b
data/lib/baselogger.rb CHANGED
@@ -42,13 +42,15 @@ module BlackStack
42
42
  ltext += "\n"
43
43
  end
44
44
 
45
+ ltext += ltime + ": "
46
+
45
47
  i=1
46
48
  while (i<self.nest_level)
47
49
  ltext += " > "
48
50
  i+=1
49
51
  end
50
52
 
51
- ltext += ltime + ": " + s
53
+ ltext += s
52
54
 
53
55
  #File.open(self.filename, 'a') { |file| file.write(ltext) }
54
56
  print ltext
@@ -64,14 +66,16 @@ module BlackStack
64
66
  t = !datetime.nil? ? datetime : Time.now
65
67
  ltime = t.strftime("%Y-%m-%d %H:%M:%S").to_s
66
68
 
67
- ltext = ""
69
+ ltext = ''
70
+
68
71
  if self.number_of_lines_in_current_level > 0
72
+ ltext = ltime + ": "
73
+
69
74
  i=1
70
75
  while (i<self.nest_level)
71
76
  ltext += " > "
72
77
  i+=1
73
78
  end
74
- ltext += ltime + ": "
75
79
  end # if self.number_of_lines_in_current_level == 0
76
80
 
77
81
  self.nest_level -= 1
@@ -94,7 +98,7 @@ module BlackStack
94
98
 
95
99
  def error(e=nil)
96
100
  self.logf("error") if e.nil?
97
- self.logf("error:#{e.to_s}.") if !e.nil?
101
+ self.logf("error: #{e.to_console}.") if !e.nil?
98
102
  end
99
103
 
100
104
  def yes()
data/lib/remotelogger.rb CHANGED
@@ -1,14 +1,15 @@
1
1
  module BlackStack
2
2
  require_relative './baselogger'
3
3
  class RemoteLogger < BlackStack::BaseLogger
4
- attr_accessor :api_protocol, :api_domain, :api_port, :api_key
4
+ attr_accessor :api_protocol, :api_domain, :api_port, :api_key, :id_client
5
5
 
6
- def initialize(the_filename, the_api_protocol, the_api_domain, the_api_port, the_api_key)
6
+ def initialize(the_filename, the_api_protocol, the_api_domain, the_api_port, the_api_key, the_id_client=nil)
7
7
  super(the_filename)
8
8
  self.api_protocol = the_api_protocol
9
9
  self.api_domain = the_api_domain
10
10
  self.api_port = the_api_port
11
11
  self.api_key = the_api_key
12
+ self.id_client = the_id_client
12
13
  end
13
14
 
14
15
  # call the parent class to set the attributes
@@ -19,6 +20,7 @@ module BlackStack
19
20
  res = BlackStack::Netting::api_call(url, {
20
21
  'api_key' => self.api_key,
21
22
  'filename' => self.filename,
23
+ 'id_client' => self.id_client,
22
24
  })
23
25
  end
24
26
 
@@ -30,6 +32,7 @@ module BlackStack
30
32
  'filename' => self.filename,
31
33
  'text' => s,
32
34
  'method' => BlackStack::BaseLogger::METHOD_LOG,
35
+ 'id_client' => self.id_client,
33
36
  })
34
37
  ltext
35
38
  end
@@ -42,6 +45,7 @@ module BlackStack
42
45
  'filename' => self.filename,
43
46
  'text' => s,
44
47
  'method' => BlackStack::BaseLogger::METHOD_LOGS,
48
+ 'id_client' => self.id_client,
45
49
  })
46
50
  ltext
47
51
  end
@@ -54,6 +58,7 @@ module BlackStack
54
58
  'filename' => self.filename,
55
59
  'text' => s,
56
60
  'method' => BlackStack::BaseLogger::METHOD_LOGF,
61
+ 'id_client' => self.id_client,
57
62
  })
58
63
  ltext
59
64
  end
@@ -63,6 +68,7 @@ module BlackStack
63
68
  res = BlackStack::Netting::api_call(url, {
64
69
  'api_key' => self.api_key,
65
70
  'filename' => self.filename,
71
+ 'id_client' => self.id_client,
66
72
  })
67
73
  end
68
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_cloud_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.17
4
+ version: 1.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-08 00:00:00.000000000 Z
11
+ date: 2019-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blackstack_commons