lib/syslogger.rb in syslogger-1.6.3 vs lib/syslogger.rb in syslogger-1.6.4
- old
+ new
@@ -2,11 +2,11 @@
require 'logger'
require 'thread'
class Syslogger
- VERSION = "1.6.3"
+ VERSION = "1.6.4"
MUTEX = Mutex.new
attr_reader :level, :ident, :options, :facility, :max_octets
attr_accessor :formatter
@@ -90,12 +90,12 @@
if message.nil? && block.nil? && !progname.nil?
message, progname = progname, nil
end
progname ||= @ident
mask = Syslog::LOG_UPTO(MAPPING[@level])
- communication = clean(message || block && block.call)
- formatted_communication = formatter.call([severity], Time.now, progname, communication)
+ communication = message || block && block.call
+ formatted_communication = clean(formatter.call([severity], Time.now, progname, communication))
MUTEX.synchronize do
Syslog.open(progname, @options, @facility) do |s|
s.mask = mask
if self.max_octets
@@ -175,10 +175,10 @@
private
def tags_text
tags = current_tags
if tags.any?
- tags.collect { |tag| "[#{tag}] " }.join
+ clean(tags.collect { |tag| "[#{tag}] " }.join) << " "
end
end
def current_tags
Thread.current[:syslogger_tagged_logging_tags] ||= []