2006-09-25 14:21:39 +02:00
|
|
|
import CryptoBoxPlugin
|
2006-09-26 10:38:45 +02:00
|
|
|
import os
|
2006-09-12 10:55:20 +02:00
|
|
|
|
2006-09-25 14:21:39 +02:00
|
|
|
class logs(CryptoBoxPlugin.CryptoBoxPlugin):
|
2006-09-12 10:55:20 +02:00
|
|
|
|
2006-10-09 18:43:14 +02:00
|
|
|
pluginCapabilities = [ "system" ]
|
|
|
|
requestAuth = False
|
2006-10-11 17:50:24 +02:00
|
|
|
rank = 90
|
2006-10-09 18:43:14 +02:00
|
|
|
|
2006-09-25 14:21:39 +02:00
|
|
|
def doAction(self):
|
|
|
|
self.__prepareFormData()
|
|
|
|
return "show_log"
|
2006-09-12 10:55:20 +02:00
|
|
|
|
|
|
|
|
2006-09-25 14:21:39 +02:00
|
|
|
def getStatus(self):
|
|
|
|
return "%s:%s:%s" % (
|
|
|
|
self.cbox.prefs["Log"]["Level"],
|
|
|
|
self.cbox.prefs["Log"]["Destination"],
|
|
|
|
self.cbox.prefs["Log"]["Details"])
|
2006-09-12 10:55:20 +02:00
|
|
|
|
2006-09-14 14:33:01 +02:00
|
|
|
|
2006-09-25 14:21:39 +02:00
|
|
|
def __prepareFormData(self):
|
|
|
|
self.hdf[self.hdf_prefix + "Content"] = self.__getLogContent()
|
2006-09-26 10:38:45 +02:00
|
|
|
self.hdf[self.hdf_prefix + "StyleSheetFile"] = os.path.abspath(os.path.join(self.pluginDir, "logs.css"))
|
2006-09-14 14:33:01 +02:00
|
|
|
|
2006-09-25 14:21:39 +02:00
|
|
|
|
|
|
|
def __getLogContent(self, lines=30, maxSize=2000):
|
|
|
|
return "<br/>".join(self.cbox.getLogData(lines, maxSize))
|
2006-09-12 10:55:20 +02:00
|
|
|
|