lib/semantic_logger/appender/file.rb in semantic_logger-4.1.1 vs lib/semantic_logger/appender/file.rb in semantic_logger-4.2.0
- old
+ new
@@ -79,11 +79,11 @@
# on the initializer.
# If :io was supplied, it will need to be re-opened manually.
def reopen
return unless @file_name
- @log = open(@file_name, (::File::WRONLY | ::File::APPEND | ::File::CREAT))
+ @log = open(@file_name, (::File::WRONLY | ::File::APPEND | ::File::CREAT))
# Force all log entries to write immediately without buffering
# Allows multiple processes to write to the same log file simultaneously
@log.sync = true
@log.set_encoding(Encoding::BINARY) if @log.respond_to?(:set_encoding)
@log
@@ -91,11 +91,9 @@
# Pass log calls to the underlying Rails, log4j or Ruby logger
# trace entries are mapped to debug since :trace is not supported by the
# Ruby or Rails Loggers
def log(log)
- return false unless should_log?(log)
-
# Since only one appender thread will be writing to the file at a time
# it is not necessary to protect access to the file with a semaphore
# Allow this logger to filter out log levels lower than it's own
@log.write(formatter.call(log, self) << "\n")
true