db_logger 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +15 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/LICENSE +7 -0
- data/README.md +24 -0
- data/Rakefile +5 -0
- data/db_logger.gemspec +24 -0
- data/lib/db_logger.rb +10 -0
- data/lib/db_logger/db_logger.rb +7 -0
- data/lib/db_logger/model_additions.rb +12 -0
- data/lib/db_logger/railtie.rb +9 -0
- data/lib/db_logger/version.rb +3 -0
- data/spec/db_logger/model_additions_spec.rb +14 -0
- data/spec/db_logger_spec.rb +10 -0
- data/spec/spec_helper.rb +2 -0
- metadata +101 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (C) 2012 Gregory Silcox
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# DB Logger
|
2
|
+
|
3
|
+
Writes log messages to a database table.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
add to your Gemfile and run the `bundle` command to install it.
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "db_logger"
|
11
|
+
```
|
12
|
+
|
13
|
+
**Requires PostgreSQL HSTORE and Rails 3.1 store.**
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
Note: this section is under construction...
|
17
|
+
1. Add a table to the database with the right columns.
|
18
|
+
2. Instantiate a DbLogger
|
19
|
+
3. Log using the appropriate level, such as log.debug( "My message" ).
|
20
|
+
|
21
|
+
## Development
|
22
|
+
Questions or problems? Please post them on the [issue tracker](https://github.com/GregSilcox/db_logger/issues). You can contribut changes by forking the project and submitting a pull requrest. You can ensure the tests are passing by running `bundle` and `rake`.
|
23
|
+
|
24
|
+
This gem is created by Greg Silcox and is under the MIT License.
|
data/Rakefile
ADDED
data/db_logger.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "db_logger/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "db_logger"
|
7
|
+
s.version = DbLogger::VERSION
|
8
|
+
s.authors = ["Greg Silcox"]
|
9
|
+
s.email = ["greg.silcox@cumulsity.com"]
|
10
|
+
s.homepage = "http://github.com/GregSilcox/db_logger"
|
11
|
+
s.summary = %q{Writes log messages to a database table.}
|
12
|
+
s.description = %q{Captures sophisticated messages throughout a rails app and stores them in a postgresql hstore field.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "db_logger"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_development_dependency "rspec"
|
22
|
+
s.add_development_dependency "rake"
|
23
|
+
s.add_development_dependency "supermodel"
|
24
|
+
end
|
data/lib/db_logger.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# test validations or anything depending on ActiveRecord
|
4
|
+
class Importer < SuperModel::Base
|
5
|
+
include ActiveModel::Validations::Callbacks
|
6
|
+
extend DbLogger::ModelAdditions
|
7
|
+
# debug "a class message"
|
8
|
+
end
|
9
|
+
|
10
|
+
describe DbLogger::ModelAdditions do
|
11
|
+
it "does nothing" do
|
12
|
+
Importer.create.should be_a( Importer )
|
13
|
+
end
|
14
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: db_logger
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Greg Silcox
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &77114250 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *77114250
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &77113250 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *77113250
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: supermodel
|
38
|
+
requirement: &77112610 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *77112610
|
47
|
+
description: Captures sophisticated messages throughout a rails app and stores them
|
48
|
+
in a postgresql hstore field.
|
49
|
+
email:
|
50
|
+
- greg.silcox@cumulsity.com
|
51
|
+
executables: []
|
52
|
+
extensions: []
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
55
|
+
- .gitignore
|
56
|
+
- .rspec
|
57
|
+
- CHANGELOG.md
|
58
|
+
- Gemfile
|
59
|
+
- LICENSE
|
60
|
+
- README.md
|
61
|
+
- Rakefile
|
62
|
+
- db_logger.gemspec
|
63
|
+
- lib/db_logger.rb
|
64
|
+
- lib/db_logger/db_logger.rb
|
65
|
+
- lib/db_logger/model_additions.rb
|
66
|
+
- lib/db_logger/railtie.rb
|
67
|
+
- lib/db_logger/version.rb
|
68
|
+
- spec/db_logger/model_additions_spec.rb
|
69
|
+
- spec/db_logger_spec.rb
|
70
|
+
- spec/spec_helper.rb
|
71
|
+
homepage: http://github.com/GregSilcox/db_logger
|
72
|
+
licenses: []
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
hash: -697232639
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
hash: -697232639
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project: db_logger
|
97
|
+
rubygems_version: 1.8.15
|
98
|
+
signing_key:
|
99
|
+
specification_version: 3
|
100
|
+
summary: Writes log messages to a database table.
|
101
|
+
test_files: []
|