Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2.0.5

### Added

- Added `isatty` method on loggers for IO compatibility.

## 2.0.4

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.4
2.0.5
8 changes: 8 additions & 0 deletions lib/lumberjack/io_compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ def tty?
false
end

# Alias for tty? to provide complete IO compatibility.
#
# @return [Boolean]
# @api private
def isatty
tty?
end

# Set the encoding for the stream. This method is provided for IO compatibility
# but is a no-op since loggers handle encoding internally through their devices
# and formatters.
Expand Down
5 changes: 5 additions & 0 deletions spec/lumberjack/io_compatibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,9 @@
it "is not a tty?" do
expect(logger.tty?).to be false
end

it "alias isatty to tty?" do
expect(logger).to receive(:isatty).and_call_original
expect(logger.isatty).to be false
end
end
Loading