diff options
author | Nick Thomas <nick@gitlab.com> | 2018-09-12 12:38:00 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-09-12 12:38:00 +0000 |
commit | ffd55318b9e3a726fcceef4466fc1d8e6be98634 (patch) | |
tree | cd4ec26471440437ce0ec79c40a31899be6f6bcf | |
parent | 181b9b0924d9d137d5c4b611d2d7271e7c81b437 (diff) | |
parent | 95e292780492ea764328566503ebefcae8a170f3 (diff) | |
download | gitlab-shell-ffd55318b9e3a726fcceef4466fc1d8e6be98634.tar.gz |
Merge branch 'sh-fix-nonatomic-puts' into 'master'v8.3.2
Fix newlines not appearing between new log entries
Closes gitlab-com/gl-infra/infrastructure#5017
See merge request gitlab-org/gitlab-shell!242
-rw-r--r-- | lib/gitlab_logger.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab_logger.rb b/lib/gitlab_logger.rb index ed169f7..67f6030 100644 --- a/lib/gitlab_logger.rb +++ b/lib/gitlab_logger.rb @@ -68,9 +68,10 @@ class GitlabLogger case log_format when 'json' - log_file.puts format_json(data) + # Don't use IO#puts because of https://bugs.ruby-lang.org/issues/14042 + log_file.print("#{format_json(data)}\n") else - log_file.puts format_text(data) + log_file.print("#{format_text(data)}\n") end end |