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
@@ -5,9 +5,9 @@ module Jlog
|
|
5
5
|
|
6
6
|
def append
|
7
7
|
message = params[:message]
|
8
|
-
level_pattern =
|
8
|
+
level_pattern = /^(DEBUG|INFO|WARN|ERROR|FATAL)/
|
9
9
|
level = message.match(level_pattern)[1]
|
10
|
-
message = 'Client
|
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)
|
data/lib/jlog/version.rb
CHANGED
@@ -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 +
|
162
|
+
namePrefix = this.getName() ? '[' + this.getName() + ']' : '',
|
163
|
+
msgString = level + namePrefix + ': ',
|
158
164
|
appenders = this.getAppenders();
|
159
165
|
|
160
166
|
for (var i in args) {
|