simple_cloud_logging 1.1.17 → 1.1.26

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d63c7caf567034c39000aa172f2cb68257c5d3f0
4
- data.tar.gz: a678ebbe28b5f6e54816593d8526e9d0aa407d0d
3
+ metadata.gz: 3db97b74c4bd4797332fe3064f28d4a14213789d
4
+ data.tar.gz: ebaff8c5548d11890fbc745d43a75338e3b19904
5
5
  SHA512:
6
- metadata.gz: 76c9b625c1b7d0a9e94c768eb3320fe4ddbe35be5118ab552c6d39b0e80bddbf04ea36e70e9a2fe1045336aeb72c452e67cf7df7f2d88bee6e34848269f89e34
7
- data.tar.gz: 86a28cce82ddb896a2572ef6de704386670ee500fe9f9761b9dc75d6f9be42c64ed3fbd30f2697e2f055a6e4809a0de6c82f292a10d809cbd1152c95b4eb5003
6
+ metadata.gz: fc5b5e9fc54f8fbbd6f2555c032369c8eb516514fc8db6ab289d800e70a39e7cea8667898a44c75c1a220e146469f78caf528e99a43e9445cf56decfe9c1c934
7
+ data.tar.gz: 4075bccfca6095f6da5d87c7e3946f66e27c243ca9a23c66d8bccdfbb2aa18113a0f523d91ccf1735b15188ad7882ccfe6e3a4ca0b76c0804e8d83eab671d21b
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,69 +1,85 @@
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
15
16
  # call the save method to store the new attributes into the data file
16
17
  def reset()
17
18
  super
19
+ =begin
18
20
  url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/reset.json"
19
21
  res = BlackStack::Netting::api_call(url, {
20
22
  'api_key' => self.api_key,
21
23
  'filename' => self.filename,
24
+ 'id_client' => self.id_client,
22
25
  })
26
+ =end
23
27
  end
24
28
 
25
29
  def log(s, datetime=nil)
26
30
  ltext = super(s, datetime)
31
+ =begin
27
32
  url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/log.json"
28
33
  res = BlackStack::Netting::api_call(url, {
29
34
  'api_key' => self.api_key,
30
35
  'filename' => self.filename,
31
36
  'text' => s,
32
37
  'method' => BlackStack::BaseLogger::METHOD_LOG,
38
+ 'id_client' => self.id_client,
33
39
  })
40
+ =end
34
41
  ltext
35
42
  end
36
43
 
37
44
  def logs(s, datetime=nil)
38
45
  ltext = super(s, datetime)
46
+ =begin
39
47
  url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/log.json"
40
48
  res = BlackStack::Netting::api_call(url, {
41
49
  'api_key' => self.api_key,
42
50
  'filename' => self.filename,
43
51
  'text' => s,
44
52
  'method' => BlackStack::BaseLogger::METHOD_LOGS,
53
+ 'id_client' => self.id_client,
45
54
  })
55
+ =end
46
56
  ltext
47
57
  end
48
58
 
49
59
  def logf(s, datetime=nil)
50
60
  ltext = super(s, datetime)
61
+ =begin
51
62
  url = "#{self.api_protocol}://#{self.api_domain}:#{self.api_port.to_s}/api1.4/scl/log.json"
52
63
  res = BlackStack::Netting::api_call(url, {
53
64
  'api_key' => self.api_key,
54
65
  'filename' => self.filename,
55
66
  'text' => s,
56
67
  'method' => BlackStack::BaseLogger::METHOD_LOGF,
68
+ 'id_client' => self.id_client,
57
69
  })
70
+ =end
58
71
  ltext
59
72
  end
60
73
 
61
74
  def release()
75
+ =begin
62
76
  url = "#{self.api_url}:#{self.api_port.to_s}/api1.4/scl/release.json"
63
77
  res = BlackStack::Netting::api_call(url, {
64
78
  'api_key' => self.api_key,
65
79
  'filename' => self.filename,
80
+ 'id_client' => self.id_client,
66
81
  })
82
+ =end
67
83
  end
68
84
  end
69
85
  end # module BlackStack
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.26
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: 2022-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blackstack_commons
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.20
19
+ version: 1.1.40
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.0.20
22
+ version: 1.1.40
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.0.20
29
+ version: 1.1.40
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.0.20
32
+ version: 1.1.40
33
33
  description: 'THIS GEM IS STILL IN DEVELOPMENT STAGE. Find documentation here: https://github.com/leandrosardi/simple_cloud_logging.'
34
34
  email: leandro.sardi@expandedventure.com
35
35
  executables: []