jlog-rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -23,6 +23,9 @@ On the client-side:
23
23
  Changelog:
24
24
  ----------
25
25
 
26
+ * 0.0.2
27
+ * Changed format of output message
28
+ * InstallGenerator now updates application.js
26
29
  * 0.0.1
27
30
  * Added InstallGenerator
28
31
  * Renamed JLog to Jlog
@@ -5,9 +5,9 @@ module Jlog
5
5
 
6
6
  def append
7
7
  message = params[:message]
8
- level_pattern = /([A-Z]*) - /
8
+ level_pattern = /^(DEBUG|INFO|WARN|ERROR|FATAL)/
9
9
  level = message.match(level_pattern)[1]
10
- message = 'Client Log: ' << message
10
+ message = 'Client ' << message
11
11
 
12
12
  if ['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'].include? level
13
13
  Rails.logger.send(level.downcase.to_sym, message)
@@ -10,5 +10,11 @@ module Jlog
10
10
  end
11
11
  end
12
12
 
13
+ def include_js_file
14
+ append_to_file 'app/assets/javascripts/application.js' do
15
+ %Q{\n//\n//= require jlog}
16
+ end
17
+ end
18
+
13
19
  end
14
20
  end
data/lib/jlog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jlog
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -24,6 +24,12 @@
24
24
  * </pre>
25
25
  */
26
26
 
27
+ /**
28
+ *
29
+ * @remixer Alexey Golubev mailto:oholubyev@heliostech.hk
30
+ *
31
+ **/
32
+
27
33
  function JLog(name) {
28
34
  var _currentLevel = JLog.ALL,
29
35
  _appenders = [new JLog.ConsoleAppender],
@@ -153,8 +159,8 @@ JLog.prototype._log = function() {
153
159
  if (this.isOn()) {
154
160
  var level = arguments[0],
155
161
  args = Array.prototype.slice.call(arguments[1]),
156
- namePrefix = this.getName() ? this.getName() + ': ' : '',
157
- msgString = level + ' - ' + namePrefix,
162
+ namePrefix = this.getName() ? '[' + this.getName() + ']' : '',
163
+ msgString = level + namePrefix + ': ',
158
164
  appenders = this.getAppenders();
159
165
 
160
166
  for (var i in args) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jlog-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: