2
2
3
3
[ ![ Build Status] ( https://secure.travis-ci.org/geraldb/logutils.png?branch=master )] ( http://travis-ci.org/geraldb/logutils )
4
4
5
- * home :: [ github.com/geraldb /logutils] ( https://github.com/geraldb /logutils )
6
- * bugs :: [ github.com/geraldb /logutils/issues] ( https://github.com/geraldb /logutils )
5
+ * home :: [ github.com/rubylibs /logutils] ( https://github.com/rubylibs /logutils )
6
+ * bugs :: [ github.com/rubylibs /logutils/issues] ( https://github.com/rubylibs /logutils )
7
7
* gem :: [ rubygems.org/gems/logutils] ( https://rubygems.org/gems/logutils )
8
8
* rdoc :: [ rubydoc.info/gems/logutils] ( http://rubydoc.info/gems/logutils )
9
9
@@ -73,62 +73,19 @@ Example:
73
73
end
74
74
75
75
76
- ### Log to the database using ` LogDb `
76
+ ### Addons / Plugins / Extensions
77
77
78
- NB: To use the ` LogDb ` machinery require the module, that is, issue:
78
+ [ logutils-activerecord ] ( https://github.com/rubylibs/logutils-activerecord ) - add LogDb, Log Models, etc.
79
79
80
- require 'logutils/db'
81
-
82
- To create the database tables use:
83
-
84
- LogDb.create
85
-
86
- To start logging to the database (established connection required) use:
87
-
88
- LogDb.setup
89
-
90
- To clean out all log records from the database use:
91
-
92
- LogDb.delete!
93
-
94
-
95
- ### All together now
96
-
97
- require 'logutils'
98
-
99
- include LogUtils # lets you use Logger instead of LogUtils::Logger
100
-
101
- logger = Logger[ 'Test' ]
102
- logger.info 'hello LogUtils'
103
-
104
-
105
- require 'logutils/db' # nb: will also require 'active_record'
106
-
107
- LOG_DB_CONFIG = {
108
- :adapter => 'sqlite3',
109
- :database => './log.db'
110
- }
111
-
112
- pp LOG_DB_CONFIG
113
- ActiveRecord::Base.establish_connection( LOG_DB_CONFIG )
114
-
115
- LogDb.create
116
- LogDb.setup
117
-
118
- logger.info 'hola LogUtils'
119
- logger.warn 'servus LogUtils'
120
-
121
-
122
- That's it.
123
80
124
81
125
82
## Real World Usage
126
83
127
- [ world.db.ruby] ( https://github.com/geraldb /world.db.ruby ) - ` world.db ` Command Line Tool
84
+ [ world.db.ruby] ( https://github.com/worlddb /world.db.ruby ) - ` world.db ` Command Line Tool
128
85
129
- [ sport.db.ruby] ( https://github.com/geraldb /sport.db.ruby ) - ` sport.db ` Command Line Tool
86
+ [ sport.db.ruby] ( https://github.com/sportdb /sport.db.ruby ) - ` sport.db ` Command Line Tool
130
87
131
- [ Sportbook] ( http ://geraldb. github.com/sportbook ) - A free, open source sports betting pool
88
+ [ Sportbook] ( https ://github.com/openbookie ) - A free, open source sports betting pool
132
89
in Ruby on Rails (version 3.2 and up).
133
90
134
91
@@ -149,4 +106,4 @@ in Ruby on Rails (version 3.2 and up).
149
106
## License
150
107
151
108
The ` logutils ` scripts are dedicated to the public domain.
152
- Use it as you please with no restrictions whatsoever.
109
+ Use it as you please with no restrictions whatsoever.
0 commit comments