YaST2 |
modules/LogView.ycp |
Displaying a log with additional functionality | |
|
|
This module has an unstable interface. |
global parameters for the log displaying widget
list of all the logs that can be displayed
index of currently selected log
list of actions that can be processed on the logs
Get the map describing the particular log file from its index
- Parameters:
-
index integer index of the log file
- Return value:
-
a map describing the log file
Starts the log reading command via process agent
- Parameters:
-
index integer the index of the log file
Kill processes running on the backgrouns
- Parameters:
-
key log widget key
Get the help for the log in case of multiple logs
- Return value:
-
part of the log
Get the help for the log in case of a single log
- Return value:
-
part of the log
Get the second part of the help for the log in case of advanced functions and save support
- Parameters:
-
label tge label of the menu button
- Return value:
-
part of the log
Get the second part of the help for the log in case of advanced functions
- Parameters:
-
label tge label of the menu button
- Return value:
-
part of the log
Get the second part of the help for the log in case of save support
- Return value:
-
part of the log
Get the help of the widget
- Parameters:
-
logs integer count of displayed logs parameters map parameters of the log to display
- Return value:
-
help to the widget
Get the combo box of the available log files
- Parameters:
-
log_maps a list of maps describing all the logs
- Return value:
-
the combo box widget
Get the widget with the menu button with actions to be processed on the log
- Parameters:
-
actions a list of all actions save boolean true if the log should be offered to be saved mb_label label of the menu button, may be empty for default
- Return value:
-
widget with the menu button
Get the buttons below the box with the log
- Parameters:
-
popup boolean true if running in popup (and Close is needed) glob_param a map of global parameters of the log widget log_maps a list of maps describing all the logs
- Return value:
-
the widget with buttons
Get the default entry for the combo box with logs
- Parameters:
-
log_maps a list of maps describing all the logs
- Return value:
-
the index of the default entry in the combo box
Switch the displayed log
- Parameters:
-
index integer index of the log to display
Initialize the displayed log
- Parameters:
-
key table widget key
Handle the event on the log view widget
- Parameters:
-
key log widget key event map event to handle
- Return value:
-
always nil
Get the map with the log view widget
- Parameters:
-
parameters map parameters of the widget to be created, will be unioned with the generated map - "save" -- boolean, if true, then log saving is possible - "actions" -- list, allows to specify additional actions. Each member is a 2- or 3-entry list, first entry is a label for the menubutton, the second one is a function that will be called when the entry is selected, the signature of the function must be void(), optional 3rd argument, if set to true, forces restarting of the log displaying command after the action is performed - "mb_label" -- string, label of the menubutton, if not specified, then "Advanced" is used - "max_lines" -- integer, maximum of lines to be displayed. If 0, then display whole file. Default is 100. - "help" -- string for a rich text, help to be offered via a popup when user clicks the "Help" button. If not present, default help is shown or Help button is hidden. - "widget_height" -- height of the LogView widget, to be adjusted so that the widget fits into the dialog well. Test it to find the best value, 15 seems to be good value (is default if not specified)
log_files a list of logs that will be displayed - "file" -- string, filename with the log - "grep" -- string, basic regular expression to be grepped in the log (for getting relevant parts of /var/log/messages. If empty or not present, whole file is used - "command" -- allows to specify comand to get the log for cases where grep isn't enough. If used, file and grep entries are ignored - "log_label" -- header of the LogView widget, if not set, then the file name or the command is used - "default" -- define and set to true to make this log be active after widget is displayed. If not defiend for any log, the first log is automatically default. If defined for multiple logs, the first one is active
- Return value:
-
the log widget
Main function for displaying logs
- Parameters:
-
parameters map description of parameters, with following keys - "file" -- string, filename with the log - "grep" -- string, basic regular expression to be grepped in the log (for getting relevant parts of /var/log/messages. If empty or not present, whole file is used - "command" -- allows to specify command to get the log for cases where grep isn't enough. If used, file and grep entries are ignored - "save" -- boolean, if true, then log saving is possible - "actions" -- list, allows to specify additional actions. Each member is a 2- or 3-entry list, first entry is a label for the menubutton, the second one is a function that will be called when the entry is selected, the signature of the function must be void(), optional 3rd argument, if set to true, forces restarting of the log displaying command after the action is performed - "help" -- string for a rich text, help to be offered via a popup when user clicks the "Help" button. If not present, Help button isn't shown - "mb_label" -- string, label of the menubutton, if not specified, then "Advanced" is used - "max_lines" -- integer, maximum of lines to be displayed. If 0, then display whole file. Default is 100. - "log_label" -- header of the LogView widget, if not set, then "Log" is used
Display specified file, list 100 lines
- Parameters:
-
file string filename of file with the log
Display log with filtering with 100 lines
- Parameters:
-
file string filename of file with the log grep string basic regular expression to be grepped in file