logutils-activerecord 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +1 -1
- data/Manifest.txt +0 -5
- data/lib/logutils/activerecord/version.rb +2 -2
- metadata +1 -6
- data/lib/logutils/server.rb +0 -58
- data/lib/logutils/server/public/style.css +0 -49
- data/lib/logutils/server/views/_version.erb +0 -5
- data/lib/logutils/server/views/index.erb +0 -26
- data/lib/logutils/server/views/layout.erb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6620f036f516361bdd7a2747ad24c5494774a39f
|
4
|
+
data.tar.gz: b9f94ef2567698a06d426c3ea117c7adc9fa7aeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0369fe85305134a2783086dc0d66385336493ca22403f2cdfa063255c083f90050a9564fa148a66ffc25a3e67e2f356bdfacc0c99d359d9ea5cfd68724de4134
|
7
|
+
data.tar.gz: b0c7d755d56b9e6d0145c323904e88431491ae908ae8db09d80e94cb48236d217ece9030c7dbb557d2e6c98c92180bdfbe07006ee6c5e91551866162a5d926c0
|
data/HISTORY.md
CHANGED
data/Manifest.txt
CHANGED
@@ -6,10 +6,5 @@ lib/logutils/activerecord.rb
|
|
6
6
|
lib/logutils/activerecord/models.rb
|
7
7
|
lib/logutils/activerecord/schema.rb
|
8
8
|
lib/logutils/activerecord/version.rb
|
9
|
-
lib/logutils/server.rb
|
10
|
-
lib/logutils/server/public/style.css
|
11
|
-
lib/logutils/server/views/_version.erb
|
12
|
-
lib/logutils/server/views/index.erb
|
13
|
-
lib/logutils/server/views/layout.erb
|
14
9
|
test/helper.rb
|
15
10
|
test/test_logger.rb
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logutils-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -84,11 +84,6 @@ files:
|
|
84
84
|
- lib/logutils/activerecord/models.rb
|
85
85
|
- lib/logutils/activerecord/schema.rb
|
86
86
|
- lib/logutils/activerecord/version.rb
|
87
|
-
- lib/logutils/server.rb
|
88
|
-
- lib/logutils/server/public/style.css
|
89
|
-
- lib/logutils/server/views/_version.erb
|
90
|
-
- lib/logutils/server/views/index.erb
|
91
|
-
- lib/logutils/server/views/layout.erb
|
92
87
|
- test/helper.rb
|
93
88
|
- test/test_logger.rb
|
94
89
|
homepage: https://github.com/rubylibs/logutils-activerecord
|
data/lib/logutils/server.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
######
|
2
|
-
# NB: use rackup to startup Sinatra service (see config.ru)
|
3
|
-
#
|
4
|
-
# e.g. config.ru:
|
5
|
-
# require './boot'
|
6
|
-
# run LogDb::Server
|
7
|
-
|
8
|
-
|
9
|
-
# 3rd party libs/gems - include/require in ./boot
|
10
|
-
### require 'sinatra/base'
|
11
|
-
|
12
|
-
|
13
|
-
# NOTE: it's an addon for logutils
|
14
|
-
# assume logutils and logutils/activerecord already required
|
15
|
-
# require 'logutils'
|
16
|
-
# require 'logutils/db'
|
17
|
-
|
18
|
-
|
19
|
-
# our own code
|
20
|
-
|
21
|
-
module LogDb
|
22
|
-
|
23
|
-
class Server < Sinatra::Base
|
24
|
-
|
25
|
-
def self.banner
|
26
|
-
"logdb-service/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] on Sinatra/#{Sinatra::VERSION} (#{ENV['RACK_ENV']})"
|
27
|
-
end
|
28
|
-
|
29
|
-
PUBLIC_FOLDER = "#{LogDb.root}/lib/logutils/server/public"
|
30
|
-
VIEWS_FOLDER = "#{LogDb.root}/lib/logutils/server/views"
|
31
|
-
|
32
|
-
puts "[boot] logdb-service - setting public folder to: #{PUBLIC_FOLDER}"
|
33
|
-
puts "[boot] logdb-service - setting views folder to: #{VIEWS_FOLDER}"
|
34
|
-
|
35
|
-
set :public_folder, PUBLIC_FOLDER # set up the static dir (with images/js/css inside)
|
36
|
-
set :views, VIEWS_FOLDER # set up the views dir
|
37
|
-
|
38
|
-
set :static, true # set up static file routing
|
39
|
-
|
40
|
-
#####################
|
41
|
-
# Models
|
42
|
-
|
43
|
-
include Models
|
44
|
-
|
45
|
-
##############################################
|
46
|
-
# Controllers / Routing / Request Handlers
|
47
|
-
|
48
|
-
get '/' do
|
49
|
-
erb :index
|
50
|
-
end
|
51
|
-
|
52
|
-
end # class Server
|
53
|
-
end # module LogDb
|
54
|
-
|
55
|
-
|
56
|
-
# say hello
|
57
|
-
puts LogDb::Server.banner
|
58
|
-
|
@@ -1,49 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
body { font-family: arial,verdana,helvetica; }
|
4
|
-
|
5
|
-
.log-id,
|
6
|
-
.log-pid,
|
7
|
-
.log-created-at { font-size: 60%; color: grey; }
|
8
|
-
|
9
|
-
.log-id { text-align: right; }
|
10
|
-
|
11
|
-
.log-level,
|
12
|
-
.log-msg { font-size: 80%; }
|
13
|
-
|
14
|
-
.log-created-at,
|
15
|
-
.log-pid,
|
16
|
-
.log-msg { white-space: nowrap; }
|
17
|
-
|
18
|
-
.log-level { font-weight: bold; }
|
19
|
-
|
20
|
-
.log-msg.warn { font-weight: bold; }
|
21
|
-
|
22
|
-
|
23
|
-
/****
|
24
|
-
* links
|
25
|
-
*/
|
26
|
-
|
27
|
-
a {
|
28
|
-
color: black;
|
29
|
-
text-decoration: none; }
|
30
|
-
a:hover {
|
31
|
-
color: black;
|
32
|
-
background-color: aqua;
|
33
|
-
text-decoration: underline; }
|
34
|
-
a:visited {
|
35
|
-
color: black; }
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
/**********
|
40
|
-
* version / powered by
|
41
|
-
*/
|
42
|
-
|
43
|
-
.version {
|
44
|
-
text-align: center;
|
45
|
-
margin-top: 10px;
|
46
|
-
color: grey; }
|
47
|
-
.version a, .version span {
|
48
|
-
font-size: 12px;
|
49
|
-
color: grey; }
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<div class='version'>
|
2
|
-
<a href="https://github.com/rubylibs/logutils">log.db/<%= LogDb::VERSION %></a> -
|
3
|
-
<span>Ruby/<%= "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE}/#{RUBY_PLATFORM})" %> on</span>
|
4
|
-
<span>Sinatra/<%= Sinatra::VERSION %> (<%= ENV['RACK_ENV'] %>)</span>
|
5
|
-
</div>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
|
2
|
-
<h3><%= Log.count %> Logs</h3>
|
3
|
-
|
4
|
-
<!-- todo:
|
5
|
-
add filter for FATAL,ERROR,WARN,etc.
|
6
|
-
add log count per kind? (e.g. 20 errors, 5 warns, etc.)
|
7
|
-
|
8
|
-
css: use colors
|
9
|
-
|
10
|
-
- error/fatal - red?
|
11
|
-
- warn - // bold or organge?
|
12
|
-
- info - normal
|
13
|
-
- debug - light grey??
|
14
|
-
-->
|
15
|
-
|
16
|
-
<table>
|
17
|
-
<% Log.all.each do |log| %>
|
18
|
-
<tr>
|
19
|
-
<td class='log-id'><%= log.id %>.</td>
|
20
|
-
<td class='log-level <%= log.level %>'>[<%= log.level %>]</td>
|
21
|
-
<td class='log-msg <%= log.level %>'><%= log.msg %></td>
|
22
|
-
<td class='log-pid'><%= "#{log.pid}.#{log.tid}" %></td>
|
23
|
-
<td class='log-created-at' <%= log.level %>'><%= log.created_at %></td>
|
24
|
-
</tr>
|
25
|
-
<% end %>
|
26
|
-
</table>
|