pretty_logger 1.3.1 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pretty_logger/pretty_logger.rb +2 -2
- data/lib/pretty_logger/request_logger.rb +2 -2
- data/lib/pretty_logger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d576e9dc2c81a5f6c33f54687f5056d19e89435d81111a8257218a9037c0e6c3
|
4
|
+
data.tar.gz: 427bda9427583eee90548fee767fc63ce32c74a7f685553384b14318f0967eeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8ff7dd8371fb1b00f69a0f3d914c22bec116f1127c73c8554f0af9519aaa2c81ccaa7790fba135afcdf45c4a981d88fa2cfeeb5359244dea378dddb7dde0c69
|
7
|
+
data.tar.gz: 79a2bddbe9aa46b88725d233f5a91a5fa9c8df27624126fc9d22e50c56bb4a9c6799a94af735aa7b30b20a6516444687ba0932d1903c383d9a0c761b50275cff
|
@@ -31,7 +31,7 @@ module PrettyLogger
|
|
31
31
|
|
32
32
|
def pretty_log(level, *messages)
|
33
33
|
message = messages.compact.map { |m| pretty_message(m) }.join("\n")
|
34
|
-
instance.send(level, "\e[90m#{timestamp}#{COLORS[level]}[#{level.to_s
|
34
|
+
instance.send(level, "\e[90m#{timestamp}#{COLORS[level]}[#{level.to_s.upcase}]\e[0m#{message}")
|
35
35
|
end
|
36
36
|
|
37
37
|
def debug(*messages)
|
@@ -39,7 +39,7 @@ module PrettyLogger
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def info(*messages)
|
42
|
-
pretty_log(
|
42
|
+
pretty_log(nil, *messages) # nil makes it so `info` level doesn't show a prefix
|
43
43
|
end
|
44
44
|
|
45
45
|
def warn(*messages)
|
@@ -9,8 +9,8 @@ class PrettyLogger::RequestLogger
|
|
9
9
|
|
10
10
|
def log_request(extra_text=nil)
|
11
11
|
info([
|
12
|
-
"#{pretty_user} #{request.method.upcase} #{request.path} #{extra_text}",
|
13
|
-
params.blank? ? nil : truncate(pretty_message(params)),
|
12
|
+
"#{pretty_user} #{request.method.upcase} #{request.path} #{extra_text}\e[0m",
|
13
|
+
params.blank? ? nil : truncate(pretty_message(params.as_json.deep_symbolize_keys)),
|
14
14
|
].compact.join("\n"))
|
15
15
|
end
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rocco Nicholls
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderay
|