logutils-admin 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d3b164b98db8cb7bc9984a29e67b2431e3fdd77
4
+ data.tar.gz: c8699776e2112c18bbaf5c062d8948883f8924f7
5
+ SHA512:
6
+ metadata.gz: ccb4d49b9b2eb18158084b096d0115e291df9d17d191b47ab57aaa1d708087059e6586b094d44afca43dc3c9e043552d0d1da08e56d6a5f187fc1c0f745f1209
7
+ data.tar.gz: 0b2f33f470e44e73c100fcfdff8607dc96ffe8661bff4580e9d10f37b600dec5d18e94eb3ccd344a4575b87f6d0fc3741952d71241ec9da2eed551341817d784
@@ -0,0 +1,4 @@
1
+ ### 0.1.0 / 2014-12-05
2
+
3
+ * Everything is new. First release
4
+
@@ -0,0 +1,10 @@
1
+ HISTORY.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ lib/logutils/admin.rb
6
+ lib/logutils/admin/public/style.css
7
+ lib/logutils/admin/version.rb
8
+ lib/logutils/admin/views/_version.erb
9
+ lib/logutils/admin/views/index.erb
10
+ lib/logutils/admin/views/layout.erb
@@ -0,0 +1,18 @@
1
+ # logutils-admin - Another Logger - Addon for Browsing Logs in Database (LogDb, Log Model etc.)
2
+
3
+ * home :: [github.com/rubylibs/logutils-admin](https://github.com/rubylibs/logutils-admin)
4
+ * bugs :: [github.com/rubylibs/logutils-admin/issues](https://github.com/rubylibs/logutils-admin)
5
+ * gem :: [rubygems.org/gems/logutils-admin](https://rubygems.org/gems/logutils-admin)
6
+ * rdoc :: [rubydoc.info/gems/logutils-admin](http://rubydoc.info/gems/logutils-admin)
7
+
8
+
9
+ ## Usage
10
+
11
+ To be done
12
+
13
+
14
+ ## License
15
+
16
+ The `logutils-admin` scripts are dedicated to the public domain.
17
+ Use it as you please with no restrictions whatsoever.
18
+
@@ -0,0 +1,35 @@
1
+ require 'hoe'
2
+ require './lib/logutils/admin/version.rb'
3
+
4
+
5
+ Hoe.spec 'logutils-admin' do
6
+
7
+ self.version = LogDbAdmin::VERSION
8
+
9
+ self.summary = 'logutils-admin - Another Logger Addon for Browsing Logs in Database (LogDb, Log Model etc.)'
10
+ self.description = summary
11
+
12
+ self.urls = ['https://github.com/rubylibs/logutils-admin']
13
+
14
+ self.author = 'Gerald Bauer'
15
+ self.email = 'opensport@googlegroups.com'
16
+
17
+ # switch extension to .markdown for gihub formatting
18
+ # -- Note: auto-changed when included in manifest
19
+ self.readme_file = 'README.md'
20
+ self.history_file = 'HISTORY.md'
21
+
22
+ self.licenses = ['Public Domain']
23
+
24
+ self.extra_deps = [
25
+ ['logutils', '>=0.6.1'],
26
+ ['logutils-activerecord', '>=0.1.2'],
27
+ ['activerecord'], # Note: will include activesupport,etc.
28
+ ['sinatra']
29
+ ]
30
+
31
+ self.spec_extras = {
32
+ required_ruby_version: '>= 1.9.2'
33
+ }
34
+
35
+ end
@@ -0,0 +1,59 @@
1
+ ######
2
+ # NB: use rackup to startup Sinatra service (see config.ru)
3
+ #
4
+ # e.g. config.ru:
5
+ # require './boot'
6
+ # run LogDbAdmin::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/activerecord'
17
+
18
+
19
+ # our own code
20
+
21
+ require 'logutils/admin/version' # Note: version always goes first
22
+
23
+
24
+
25
+ module LogDbAdmin
26
+
27
+
28
+ class Server < Sinatra::Base
29
+
30
+ PUBLIC_FOLDER = "#{LogDbAdmin.root}/lib/logutils/server/public"
31
+ VIEWS_FOLDER = "#{LogDbAdmin.root}/lib/logutils/server/views"
32
+
33
+ puts "[boot] logdb-admin - setting public folder to: #{PUBLIC_FOLDER}"
34
+ puts "[boot] logdb-admin - setting views folder to: #{VIEWS_FOLDER}"
35
+
36
+ set :public_folder, PUBLIC_FOLDER # set up the static dir (with images/js/css inside)
37
+ set :views, VIEWS_FOLDER # set up the views dir
38
+
39
+ set :static, true # set up static file routing
40
+
41
+ #####################
42
+ # Models
43
+
44
+ include LogDb::Models
45
+
46
+ ##############################################
47
+ # Controllers / Routing / Request Handlers
48
+
49
+ get '/' do
50
+ erb :index
51
+ end
52
+
53
+ end # class Server
54
+ end # module LogDbAdmin
55
+
56
+
57
+ # say hello
58
+ puts LogDbAdmin.banner
59
+
@@ -0,0 +1,49 @@
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; }
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+
3
+ module LogDbAdmin
4
+
5
+ MAJOR = 0 ## todo: namespace inside version or something - why? why not??
6
+ MINOR = 1
7
+ PATCH = 0
8
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
9
+
10
+ def self.version
11
+ VERSION
12
+ end
13
+
14
+ def self.banner
15
+ "logdb-admin/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] on Sinatra/#{Sinatra::VERSION} (#{ENV['RACK_ENV']})"
16
+ end
17
+
18
+ def self.root
19
+ "#{File.expand_path( File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) )}"
20
+ end
21
+
22
+ end # module LogDbAdmin
@@ -0,0 +1,5 @@
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>
@@ -0,0 +1,26 @@
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>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='UTF-8'>
5
+ <title>Logs</title>
6
+ <link href="<%= url('/style.css') %>" rel='stylesheet'>
7
+ </head>
8
+ <body>
9
+
10
+ <%= yield %>
11
+
12
+ <%= erb :'_version' %>
13
+
14
+ </body>
15
+ </html>
metadata ADDED
@@ -0,0 +1,144 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: logutils-admin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Gerald Bauer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logutils
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: logutils-activerecord
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: activerecord
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '4.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '4.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: hoe
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.13'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.13'
97
+ description: logutils-admin - Another Logger Addon for Browsing Logs in Database (LogDb,
98
+ Log Model etc.)
99
+ email: opensport@googlegroups.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files:
103
+ - HISTORY.md
104
+ - Manifest.txt
105
+ - README.md
106
+ files:
107
+ - HISTORY.md
108
+ - Manifest.txt
109
+ - README.md
110
+ - Rakefile
111
+ - lib/logutils/admin.rb
112
+ - lib/logutils/admin/public/style.css
113
+ - lib/logutils/admin/version.rb
114
+ - lib/logutils/admin/views/_version.erb
115
+ - lib/logutils/admin/views/index.erb
116
+ - lib/logutils/admin/views/layout.erb
117
+ homepage: https://github.com/rubylibs/logutils-admin
118
+ licenses:
119
+ - Public Domain
120
+ metadata: {}
121
+ post_install_message:
122
+ rdoc_options:
123
+ - "--main"
124
+ - README.md
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: 1.9.2
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 2.4.2
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: logutils-admin - Another Logger Addon for Browsing Logs in Database (LogDb,
143
+ Log Model etc.)
144
+ test_files: []