diff --git a/CHANGES.md b/CHANGES.md
index ef79cb49..4f781c18 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -190,6 +190,7 @@
* Add search setting "Disable auto full backlog"
* Change improve performance and reduce start up time
* Fix button "Checkout branch" when stuck on disabled
+* Add 'Download Log' to 'Logs & Errors' page
[develop changelog]
* Change send nzb data to NZBGet for Anizb instead of url
diff --git a/gui/slick/css/fonts/sgicons.eot b/gui/slick/css/fonts/sgicons.eot
index dd64fd40..33f43000 100644
Binary files a/gui/slick/css/fonts/sgicons.eot and b/gui/slick/css/fonts/sgicons.eot differ
diff --git a/gui/slick/css/fonts/sgicons.svg b/gui/slick/css/fonts/sgicons.svg
index 514dcaa3..dcc47b4d 100644
--- a/gui/slick/css/fonts/sgicons.svg
+++ b/gui/slick/css/fonts/sgicons.svg
@@ -1,46 +1,52 @@
-
diff --git a/gui/slick/css/fonts/sgicons.ttf b/gui/slick/css/fonts/sgicons.ttf
index c6ce308a..e5da9210 100644
Binary files a/gui/slick/css/fonts/sgicons.ttf and b/gui/slick/css/fonts/sgicons.ttf differ
diff --git a/gui/slick/css/fonts/sgicons.woff b/gui/slick/css/fonts/sgicons.woff
index d8b09ab3..24352c51 100644
Binary files a/gui/slick/css/fonts/sgicons.woff and b/gui/slick/css/fonts/sgicons.woff differ
diff --git a/gui/slick/css/style.css b/gui/slick/css/style.css
index 174ed9c2..e506273b 100644
--- a/gui/slick/css/style.css
+++ b/gui/slick/css/style.css
@@ -502,6 +502,10 @@ inc_top.tmpl
content:"\e621"
}
+.sgicon-download:before{
+ content:"\e626"
+}
+
.sgicon-emby:before {
content: "\e900"
}
diff --git a/gui/slick/js/inc_top.js b/gui/slick/js/inc_top.js
index 00187472..2a21bf8f 100644
--- a/gui/slick/js/inc_top.js
+++ b/gui/slick/js/inc_top.js
@@ -6,6 +6,7 @@ function initActions() {
$('#SubMenu a:contains("Remove")').addClass('btn remove').html('Remove');
$('#SubMenu a:contains("Clear History")').addClass('btn clearhistory').html('Clear History');
$('#SubMenu a:contains("Trim History")').addClass('btn trimhistory').html('Trim History');
+ $('#SubMenu a[href$="/errorlogs/downloadlog/"]').addClass('btn').html('Download Log');
$('#SubMenu a[href$="/errorlogs/clearerrors/"]').addClass('btn').html('Clear Errors');
$('#SubMenu a:contains("Re-scan")').addClass('btn').html('Re-scan');
$('#SubMenu a:contains("Backlog Overview")').addClass('btn').html('Backlog Overview');
diff --git a/sickbeard/logger.py b/sickbeard/logger.py
index c0c7a159..7be0b115 100644
--- a/sickbeard/logger.py
+++ b/sickbeard/logger.py
@@ -312,4 +312,8 @@ def close():
def log_set_level():
if sb_log_instance.cur_handler:
- sb_log_instance.cur_handler.setLevel(reverseNames[sickbeard.FILE_LOGGING_PRESET])
\ No newline at end of file
+ sb_log_instance.cur_handler.setLevel(reverseNames[sickbeard.FILE_LOGGING_PRESET])
+
+
+def current_log_file():
+ return os.path.join(sickbeard.LOG_DIR, sb_log_instance.log_file)
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index b90bfd0c..bab1ebc9 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -5480,7 +5480,8 @@ class UI(MainHandler):
class ErrorLogs(MainHandler):
@staticmethod
def ErrorLogsMenu():
- return [{'title': 'Clear Errors', 'path': 'errorlogs/clearerrors/'},]
+ return [{'title': 'Download Log', 'path': 'errorlogs/downloadlog/'},
+ {'title': 'Clear Errors', 'path': 'errorlogs/clearerrors/'},]
def index(self, *args, **kwargs):
@@ -5493,6 +5494,12 @@ class ErrorLogs(MainHandler):
classes.ErrorViewer.clear()
self.redirect('/errorlogs/')
+ def downloadlog(self, *args, **kwargs):
+ self.set_header('Content-Type', 'text/plain')
+ self.set_header('Content-Disposition', 'attachment; filename=sickgear.log')
+ with open(logger.current_log_file(), 'r') as logfile:
+ return logfile.read()
+
def viewlog(self, minLevel=logger.MESSAGE, maxLines=500):
t = PageTemplate(headers=self.request.headers, file='viewlogs.tmpl')