debug_logging 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/debug_logging/argument_printer.rb +5 -4
- data/lib/debug_logging/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11d8fe9ceeaecfffea430e6afdea66192989b54b
|
4
|
+
data.tar.gz: 944312ab8b5b9e6bed9244061bf1729025f8f5e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09299cba0ecee956bd181200581aff733d2e7191bb12c0205c0824628053cd93cddaf7292f211c41af04b7b2cff8932ce10dd5bc076eeac4bef4329c4dae7239'
|
7
|
+
data.tar.gz: 382299db6848950089ee4bfe36e46c9ce81a1930aee4a9aca183be7a33d7d74d7668e1d31e96b0d8bc1b24cea9f37ae84252742bd34c3f68b6e03b2307865845
|
data/README.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# DebugLogging
|
2
2
|
|
3
|
+
Unobtrusive, inheritable-overridable-configurable, drop-in debug logging, that won't leave a mess behind when it is time to remove it.
|
4
|
+
|
5
|
+
### Gives you (all are optional):
|
6
|
+
* *benchmarking*
|
7
|
+
* *colorization by class/method*
|
8
|
+
* *robust argument printer with customizable ellipsis*
|
9
|
+
* *unique invocation identifiers*
|
10
|
+
* *single line config*
|
11
|
+
* *separate logger*
|
12
|
+
* a free pony
|
13
|
+
|
3
14
|
| Project | DebugLogging |
|
4
15
|
|------------------------ | ----------------- |
|
5
16
|
| gem name | debug_logging |
|
@@ -39,11 +39,12 @@ module DebugLogging
|
|
39
39
|
last_hash_args, other_args = args.partition do |arg|
|
40
40
|
arg.is_a?(Hash)
|
41
41
|
end
|
42
|
-
other_args_string = other_args.map(&:inspect).join(", ")
|
42
|
+
other_args_string = other_args.map(&:inspect).join(", ")[0..(config_proxy.debug_args_max_length)]
|
43
|
+
# On the debug_multiple_last_hashes truthy branch we don't print the ellipsis after regular args
|
44
|
+
# because it will go instead after the last hash (if needed)
|
45
|
+
# ...join(", ").tap {|x| _add_args_ellipsis = x.length > config_proxy.debug_args_max_length}
|
43
46
|
last_hash_args_string = last_hash_args.map do |arg|
|
44
|
-
|
45
|
-
debug_last_hash_to_s_proc.
|
46
|
-
call(arg)).
|
47
|
+
config_proxy.debug_last_hash_to_s_proc.call(arg).to_s.
|
47
48
|
tap {|x|
|
48
49
|
add_last_hash_ellipsis = x.length > config_proxy.debug_last_hash_max_length
|
49
50
|
}[0..(config_proxy.debug_last_hash_max_length)].
|