mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Add api and websocket to preformatted log reader
This commit is contained in:
parent
39da58d3bc
commit
58712a2d05
1 changed files with 9 additions and 2 deletions
|
@ -2537,9 +2537,16 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth(member_of("admin"))
|
@requireAuth(member_of("admin"))
|
||||||
def logFile(self, **kwargs):
|
def logFile(self, logfile='', **kwargs):
|
||||||
|
if logfile == "plexpy_api":
|
||||||
|
filename = logger.FILENAME_API
|
||||||
|
elif logfile == "plexpy_websocket":
|
||||||
|
filename = logger.FILENAME_WEBSOCKET
|
||||||
|
else:
|
||||||
|
filename = logger.FILENAME
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(plexpy.CONFIG.LOG_DIR, logger.FILENAME), 'r') as f:
|
with open(os.path.join(plexpy.CONFIG.LOG_DIR, filename), 'r') as f:
|
||||||
return '<pre>%s</pre>' % f.read()
|
return '<pre>%s</pre>' % f.read()
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
return "Log file not found."
|
return "Log file not found."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue