Skip to content

Commit

Permalink
Update tail.cr
Browse files Browse the repository at this point in the history
  • Loading branch information
j8r committed Nov 10, 2019
1 parent 8ce6d77 commit 2d57d19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
mysql:
github: crystal-lang/crystal-mysql
tail:
github: j8r/tail
github: j8r/tail.cr
semantic_compare:
github: j8r/semantic_compare

Expand Down
4 changes: 2 additions & 2 deletions src/prefix/app.cr
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,9 @@ struct DPPM::Prefix::App
def get_logs(stream_name : String, follow : Bool = true, lines : Int32? = nil, &block : String ->)
log_file = (logs_path / stream_name).to_s + LOG_EXTENSION
if follow
Tail::File.new(log_file).follow(lines: (lines || 10), &block)
Tail::File.open log_file, &.follow(lines: (lines || 10), &block)
elsif lines
yield Tail::File.new(log_file).last_lines(lines: lines.to_i).join '\n'
yield Tail::File.open log_file, &.last_lines(lines: lines.to_i).join '\n'
else
yield File.read log_file
end
Expand Down

0 comments on commit 2d57d19

Please sign in to comment.