utopia 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utopia/logger.rb +2 -11
- data/lib/utopia/version.rb +1 -1
- data/setup/site/tasks/log.rake +3 -3
- data/utopia.gemspec +1 -1
- metadata +5 -6
- data/lib/utopia/logger/compact_formatter.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9b8589a3313f00ec6c24f36f42a17beb9daa7b07b45051f5cd7d08adc593960
|
4
|
+
data.tar.gz: d79f6ad3105f73acf2abd1e77698540578e98821f70c85ce9a15112c20b455ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67c0162c3bea51d90699b68d25dd599dc1576a7a2ee7369ed52c42f00a54c8eeccda3884b34c432002160cd97d425fe9605cdcae223e495c414df8c49f64e7c2
|
7
|
+
data.tar.gz: 661de3edd3e48871e2d6bd7c786e2d3db39ec4bbd77c0eb8df4cbb86ccd634782333ff667bb9f6a466eb014a535d76557a7b94b7dd75a76f2c46666006ed8702
|
data/lib/utopia/logger.rb
CHANGED
@@ -18,17 +18,8 @@
|
|
18
18
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
19
|
# THE SOFTWARE.
|
20
20
|
|
21
|
-
|
21
|
+
require 'event/console'
|
22
22
|
|
23
23
|
module Utopia
|
24
|
-
|
25
|
-
module Logger
|
26
|
-
def self.new(output: STDERR, level: ::Logger::WARN)
|
27
|
-
log = ::Logger.new(output)
|
28
|
-
log.level = level
|
29
|
-
log.formatter = Utopia::Logger::CompactFormatter.new
|
30
|
-
|
31
|
-
return log
|
32
|
-
end
|
33
|
-
end
|
24
|
+
extend Event::Console
|
34
25
|
end
|
data/lib/utopia/version.rb
CHANGED
data/setup/site/tasks/log.rake
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
|
2
2
|
task :log do
|
3
3
|
require 'utopia/logger'
|
4
|
-
LOGGER = Utopia
|
4
|
+
LOGGER = Utopia.logger
|
5
5
|
end
|
6
6
|
|
7
7
|
namespace :log do
|
8
8
|
desc "Increase verbosity of logger to info."
|
9
9
|
task :info => :log do
|
10
|
-
LOGGER.
|
10
|
+
LOGGER.info!
|
11
11
|
end
|
12
12
|
|
13
13
|
desc "Increase verbosity of global debug."
|
14
14
|
task :debug => :log do
|
15
|
-
LOGGER.
|
15
|
+
LOGGER.debug!
|
16
16
|
end
|
17
17
|
end
|
data/utopia.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -53,19 +53,19 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: event
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.1'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -578,7 +578,6 @@ files:
|
|
578
578
|
- lib/utopia/locale.rb
|
579
579
|
- lib/utopia/localization.rb
|
580
580
|
- lib/utopia/logger.rb
|
581
|
-
- lib/utopia/logger/compact_formatter.rb
|
582
581
|
- lib/utopia/middleware.rb
|
583
582
|
- lib/utopia/path.rb
|
584
583
|
- lib/utopia/path/matcher.rb
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
-
# of this software and associated documentation files (the "Software"), to deal
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
8
|
-
# furnished to do so, subject to the following conditions:
|
9
|
-
#
|
10
|
-
# The above copyright notice and this permission notice shall be included in
|
11
|
-
# all copies or substantial portions of the Software.
|
12
|
-
#
|
13
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
-
# THE SOFTWARE.
|
20
|
-
|
21
|
-
require 'logger'
|
22
|
-
require 'rainbow'
|
23
|
-
|
24
|
-
module Utopia
|
25
|
-
module Logger
|
26
|
-
# Provides a concise log output format.
|
27
|
-
class CompactFormatter
|
28
|
-
def initialize
|
29
|
-
@start = Time.now
|
30
|
-
end
|
31
|
-
|
32
|
-
def time_offset_string
|
33
|
-
offset = Time.now - @start
|
34
|
-
|
35
|
-
"T+#{offset.round(1).to_s.ljust(5)}"
|
36
|
-
end
|
37
|
-
|
38
|
-
def call(severity, datetime, progname, message)
|
39
|
-
if progname
|
40
|
-
"#{Rainbow(time_offset_string).bright.blue} #{Rainbow(progname).bright}: #{message}\n"
|
41
|
-
else
|
42
|
-
"#{Rainbow(time_offset_string).bright.blue} #{message}\n"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|