Skip to content

Commit

Permalink
[CP][AIRFLOW-3121] Define closed property on StreamLogWriter (apache#…
Browse files Browse the repository at this point in the history
  • Loading branch information
msumit authored Jun 18, 2020
1 parent ffd1d0c commit 7b52a71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions airflow/utils/log/logging_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def _set_context(self, context):
set_context(self.log, context)


# TODO: Formally inherit from io.IOBase
class StreamLogWriter(object):
encoding = False

Expand All @@ -83,6 +84,16 @@ def __init__(self, logger, level):
self.level = level
self._buffer = str()

@property
def closed(self):
"""
Returns False to indicate that the stream is not closed (as it will be
open for the duration of Airflow's lifecycle).
For compatibility with the io.IOBase interface.
"""
return False

def write(self, message):
"""
Do whatever it takes to actually log the specified logging record
Expand Down
2 changes: 1 addition & 1 deletion airflow/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
# under the License.
#

version = '1.10.4+twtr11'
version = '1.10.4+twtr12'

0 comments on commit 7b52a71

Please sign in to comment.