pretty_logger 1.4.4 → 1.4.5
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 +1 -1
- data/lib/pretty_logger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 583adf93c7847ddb950c5c735f953436418360e429b1dc32613d4e349b49f4f9
|
4
|
+
data.tar.gz: 23992dcdfde8f6cd81a6a6ce9b701e57e363473c5cb0ab63ec0962b3a9a963a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 242b8ee0c11ada7ddc9138cb4e151decf0f94b4cdfecff26da7b899d70bc820e6669a26df2925bf8b02cade1b3dbb61fc9d9dd7a63a08f52e7805394e96f52a5
|
7
|
+
data.tar.gz: ef2f2bc955619f9dd2fdbcda350282cc2bd0fca05016e1ee465333ff0c5792d4c2bf80749d6ea2ea34f4e3daa2d9b2b71ab7de3d84de0fee5a630d8c817071dc
|
@@ -31,8 +31,8 @@ module PrettyLogger
|
|
31
31
|
|
32
32
|
def pretty_log(level, *messages)
|
33
33
|
message = messages.compact.map { |m| pretty_message(m) }.join("\n")
|
34
|
-
|
35
|
-
instance.send(level || :info, "\e[90m#{timestamp}#{
|
34
|
+
level_indicator = level.presence && "#{COLORS[level]}[#{level.to_s.upcase}]"
|
35
|
+
instance.send(level || :info, "\e[90m#{timestamp}#{level_indicator}\e[0m#{message}")
|
36
36
|
end
|
37
37
|
|
38
38
|
def debug(*messages)
|
@@ -9,7 +9,7 @@ class PrettyLogger::RequestLogger
|
|
9
9
|
|
10
10
|
def log_request(extra_text=nil)
|
11
11
|
info([
|
12
|
-
"#{pretty_user}
|
12
|
+
"#{pretty_user}#{request.method.upcase} #{request.path} #{extra_text}\e[0m",
|
13
13
|
params.blank? ? nil : truncate(pretty_message(params.as_json.deep_symbolize_keys)),
|
14
14
|
].compact.join("\n"))
|
15
15
|
end
|