simple_cloud_logging 1.2.4 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/baselogger.rb +10 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bbe486d02c7e3d333c061314ac82a8a7e8f654ef7f731c26fb68ef556a92e57
4
- data.tar.gz: 5422ec3e5aa4071f70b5e85d7b8930330e8635ba4f1521d5e4f34c485768e21b
3
+ metadata.gz: f33fe774542d11213b95c2092ee13ac688e1011ca65e0aa240993109a7294ff8
4
+ data.tar.gz: 539dd9ced7250c36873db76eb86577053a7d43d9e66e74eb18e32ac4a293ecc1
5
5
  SHA512:
6
- metadata.gz: 563c894ffa0c86ba84d2998e8dee00006a409e23b8358c59d3f777c8279544b1a8f4024548a8427c39a4f0adc11844507c2928ba1d082ea9e7bab7bb0ce352a3
7
- data.tar.gz: 13eb9ab209c45d44c79616e008a098f4123fbc05ded6cf2d3b0bf2c7551c15a60ec32debf6998aad26a054e245a3f7abed90558f3dfe00c143486701474c5f3e
6
+ metadata.gz: 637d485c0c4dc8a3d478e736907ceed432e9a95b0d01962ae1fd1da029072ab120985d2999013955a81d22968a3c693960ad19c31d7417c7e4a22eb15ba30bd3
7
+ data.tar.gz: 8e69eb2a2c92b918cfa527da8a49e84b50963fa51eb49a37a09c5aca5504fab9dbe61f86a6b17c876f404b525f42716cb201919886626b8560250ad691c15a05
data/README.md CHANGED
@@ -490,7 +490,7 @@ end # class FooClass
490
490
 
491
491
  ## 18. Versioning
492
492
 
493
- We use [SemVer](http://semver.org/) for versioning. For the versions available, see the last [ruby gem](https://rubygems.org/gems/simple_command_line_parser).
493
+ We use [SemVer](http://semver.org/) for versioning. For the versions available, see the last [ruby gem](https://rubygems.org/gems/simple_cloud_logging).
494
494
 
495
495
  ## 19. Authors
496
496
 
data/lib/baselogger.rb CHANGED
@@ -141,9 +141,16 @@ module BlackStack
141
141
  # - https://stackoverflow.com/questions/37564928/how-to-find-out-from-which-line-number-the-method-was-called-in-ruby
142
142
  # - https://ruby-doc.org/core-2.2.3/Thread/Backtrace/Location.html
143
143
  #binding.pry if s == "Looking for number 3... "
144
- caller = caller_locations(0..).last
145
- #binding.pry if s == '1... '
146
- #binding.pry if s == '4... '
144
+
145
+ # Get the file and line from where this method logs was called
146
+ # - References:
147
+ # - https://github.com/leandrosardi/simple_cloud_logging/issues/6
148
+ #
149
+ callers = caller_locations(0..).to_a
150
+ prev_caller = callers.select { |c| c.to_s.include?('locallogger.rb') }.last
151
+ prev_index = callers.index(prev_caller)
152
+ caller = callers[prev_index+1].to_s
153
+
147
154
  # if the parent level was called from the same line, I am missing to close the parent.
148
155
  if self.level_open_callers[self.level-1].to_s == caller.to_s
149
156
  if Logger.nesting_assertion
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_cloud_logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi