aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-03-09 18:08:16 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-03-09 18:08:16 +0100
commit9e55e37a2e0e3a4e7d3fac2efd4ea13efe689b0e (patch)
treed77de1b25da3c63f93142fc3fa781e2872965b72 /youtube_dl/YoutubeDL.py
parenta4ff6c4762fd01b606d54a2962530c753d4c52ec (diff)
parent14719565733c114320e99228cf2dc570f8c3b6dc (diff)
downloadyoutube-dl-9e55e37a2e0e3a4e7d3fac2efd4ea13efe689b0e.tar.xz
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rw-r--r--youtube_dl/YoutubeDL.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 6fd0969b5..fcb8dd19c 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -370,12 +370,15 @@ class YoutubeDL(object):
Print the message to stderr, it will be prefixed with 'WARNING:'
If stderr is a tty file the 'WARNING:' will be colored
'''
- if self._err_file.isatty() and os.name != 'nt':
- _msg_header = '\033[0;33mWARNING:\033[0m'
+ if self.params.get('logger') is not None:
+ self.params['logger'].warning(message)
else:
- _msg_header = 'WARNING:'
- warning_message = '%s %s' % (_msg_header, message)
- self.to_stderr(warning_message)
+ if self._err_file.isatty() and os.name != 'nt':
+ _msg_header = '\033[0;33mWARNING:\033[0m'
+ else:
+ _msg_header = 'WARNING:'
+ warning_message = '%s %s' % (_msg_header, message)
+ self.to_stderr(warning_message)
def report_error(self, message, tb=None):
'''