summaryrefslogtreecommitdiff
path: root/lib/rbot/journal.rb
diff options
context:
space:
mode:
authorMatthias Hecker <apoc@geekosphere.org>2015-06-14 20:52:47 +0200
committerMatthias Hecker <apoc@geekosphere.org>2015-06-14 20:52:47 +0200
commit6ead2df0ba73243c0d1805324b0fe64d85c08bac (patch)
tree97db39d2520abfca554dfc1587af124347f053ea /lib/rbot/journal.rb
parentdd06ceee0c26703a73acb225a6500579f38c8c3e (diff)
journal, integrated in bot
Diffstat (limited to 'lib/rbot/journal.rb')
-rw-r--r--lib/rbot/journal.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rbot/journal.rb b/lib/rbot/journal.rb
index a25f3a9f..5045f9d5 100644
--- a/lib/rbot/journal.rb
+++ b/lib/rbot/journal.rb
@@ -125,8 +125,8 @@ module Journal
end
end
- def create(name, uri)
- log 'load journal storage adapter: ' + name
+ def self.create(name, uri)
+ warning 'load journal storage adapter: ' + name
load File.join(File.dirname(__FILE__), 'journal', name + '.rb')
cls = AbstractStorage.get_impl.first
cls.new(uri: uri)
@@ -285,6 +285,7 @@ module Journal
def initialize(opts={})
# overrides the internal consumer with a block
@consumer = opts[:consumer]
+ @bot = opts[:bot]
# storage backend
if @bot
@storage = opts[:storage] || Storage.create(
@@ -292,6 +293,9 @@ module Journal
else
@storage = opts[:storage]
end
+ unless @storage
+ warning 'journal broker: no storage set up, won\'t persist messages'
+ end
@queue = Queue.new
# consumer thread:
@thread = Thread.new do