onlyoffice_logger_helper 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7fbaf05d7ebedfc363344e744ec26d60c4b2588
|
4
|
+
data.tar.gz: 6ea64b064670d7eeae6bbb2049c904184a84962a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34767acb230e540ff27dfb0d1d9e95f142850dce271a75b012fa98ece50b999af88c5e5d00cd9c6c0ca1e5d2685a51c4b4da7d9d42787ac850c2a4fa1288dc23
|
7
|
+
data.tar.gz: 56146cbc95bf3f9d4c146995b3053a18fd66470cee4eb4b9fb9087155d442e18f57ab5e728170747e60339c4f7fdd57c89a20b8321907d9b0d6c65b394662f0f
|
@@ -1,16 +1,13 @@
|
|
1
|
-
|
1
|
+
# Module for output stuff in console
|
2
2
|
module OnlyofficeLoggerHelper
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
color_code ? puts(colorize(message, color_code)) : puts(message)
|
10
|
-
end
|
3
|
+
def self.log(entry, color_code = nil)
|
4
|
+
caller_name = caller[0].to_s[/\w+.rb/].chomp('.rb')
|
5
|
+
time_stamp = Time.now.strftime('%T/%d.%m.%y')
|
6
|
+
message = "#{time_stamp} [#{caller_name}] #{entry}"
|
7
|
+
color_code ? puts(colorize(message, color_code)) : puts(message)
|
8
|
+
end
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
end
|
10
|
+
def self.colorize(text, color_code)
|
11
|
+
"\e[#{color_code}m#{text}\e[0m"
|
15
12
|
end
|
16
13
|
end
|