redis_syslog 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/redis_syslog/version.rb +1 -1
- data/lib/redis_syslog.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b412edcf43c1d2b439f46717d4c5af955225202
|
4
|
+
data.tar.gz: feff4048fc2c079a933cd3c42e588f57c8b7365e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a0c832ecc5d42bb1b3630a836e0b87df7d16b1018cbb1dd0855c317418f1cec4f982d3e763d7c609b11de5930a194489992a4a11c0e004f871371f22862f545
|
7
|
+
data.tar.gz: 9473eedef0f8ee10ecb0971a7024bf9c5a19b06ccbb6f400e8db7c4d56808101df35b5bd327474509f759bcc5c31f228f1c3fe80103bfeb7b80fdb1bdc3b6e99
|
data/README.md
CHANGED
data/lib/redis_syslog/version.rb
CHANGED
data/lib/redis_syslog.rb
CHANGED
@@ -25,11 +25,11 @@ class RedisSyslog::RedisSyslog
|
|
25
25
|
raise "n cannot be 0" unless n > 0
|
26
26
|
#Return the last N entries of this log
|
27
27
|
results = @redis.zrevrange _key, 0, n-1, :with_scores => true
|
28
|
-
results = results.map{|e| {:time => Time.at(e[1]), :message => e[0]} }
|
28
|
+
results = results.map{|e| {:time => Time.at(e[1]), :message => e[0][8..-1]} }
|
29
29
|
end
|
30
30
|
|
31
31
|
def write message
|
32
|
-
@redis.zadd _key, Time.now.to_i, message
|
32
|
+
@redis.zadd _key, Time.now.to_i, "#{[*('A'..'Z')].sample(8).join}#{message}"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|