Api doc base

This commit is contained in:
Ruud
2012-02-21 17:16:02 +01:00
parent adc755dbd5
commit 7df24643ac
11 changed files with 280 additions and 22 deletions
+21 -3
View File
@@ -12,9 +12,27 @@ log = CPLog(__name__)
class Logging(Plugin):
def __init__(self):
addApiView('logging.get', self.get)
addApiView('logging.clear', self.clear)
addApiView('logging.log', self.log)
addApiView('logging.get', self.get, docs = {
'desc': 'Get the full log file by number',
'params': {
'nr': {'desc': 'Number of the log to get.'}
},
'return': {'type': 'object', 'example': """{
'success': True,
'log': string, //Log file
'total': int, //Total log files available
}"""}
})
addApiView('logging.clear', self.clear, docs = {
'desc': 'Remove all the log files'
})
addApiView('logging.log', self.log, docs = {
'desc': 'Get the full log file by number',
'params': {
'type': {'desc': 'Type of logging, default "error"'},
'**kwargs': {'type':'object', 'desc': 'All other params will be printed in the log string.'},
}
})
def get(self):