Todo
Write documentation on logging.js.
logging.py - A plugin for Gate One that provides logging-related functionality.
This Python plugin file implements the following hooks:
hooks = {
'WebSocket': {
'logging_get_logs': enumerate_logs,
'logging_get_log_flat': retrieve_log_flat,
'logging_get_log_playback': retrieve_log_playback,
'logging_get_log_file': save_log_playback,
}
}
Returns the frames of golog_path as a list that can be used with the playback_log.html template.
If limit is given, only return that number of frames (e.g. for preview)
Calls _enumerate_logs() via a multiprocessing.Process so it doesn't cause the IOLoop to block.
Log objects will be returned to the client one at a time by sending 'logging_log' actions to the client over the WebSocket (tws).
Enumerates all of the user's logs and sends the client a "logging_logs" message with the result.
If limit is given, only return the specified logs. Works just like MySQL: limit="5,10" will retrieve logs 5-10.
Calls _retrieve_log_flat() via a multiprocessing.Process so it doesn't cause the IOLoop to block.
Parameters: |
|
---|
Here's the details on settings:
Parameters: |
|
---|
Writes the given log_filename to queue in a flat format equivalent to:
./logviewer.py --flat log_filename
settings - A dict containing the log_filename, colors, and theme to use when generating the HTML output.
Calls _retrieve_log_playback() via a multiprocessing.Process so it doesn't cause the IOLoop to block.
Writes a JSON-encoded message to the client containing the log in a self-contained HTML format similar to:
./logviewer.py log_filename
settings - A dict containing the log_filename, colors, and theme to use when generating the HTML output.
Parameters: |
|
---|
The output will look like this:
{
'result': "Success",
'log': <HTML rendered output>,
'metadata': {<metadata of the log>}
}
It is expected that the client will create a new window with the result of this method.
Calls _save_log_playback() via a multiprocessing.Process so it doesn't cause the IOLoop to block.
Writes a JSON-encoded message to the client containing the log in a self-contained HTML format similar to:
./logviewer.py log_filename
The difference between this function and _retrieve_log_playback() is that this one instructs the client to save the file to disk instead of opening it in a new window.
Parameters: |
|
---|
The output will look like this:
{
'result': "Success",
'data': <HTML rendered output>,
'mimetype': 'text/html'
'filename': <filename of the log recording>
}
It is expected that the client will create a new window with the result of this method.