YaST2 Developers Documentation: YaST2



functions
files
intro

YaST2

modules/LogView.ycp
Displaying a log with additional functionality

Imports

  • Label
  • Popup
  • Report

Global Functions

Local Functions

local DeleteOldLines (list<string> lines, integer max_lines) -> list<string>

Remove unneeded items from a list If max_lines is 0, then don't remove anything

Parameters:
lines a list of strings representing log lines
max_lines integer lines that should be saved
Return value:
a list last max_lines of lines

global Display (map<string, any> param) -> void

Main function for displaying logs

Parameters:
param map description of parameters, with following keys
  - "file" -- string, filename with the log
  - "grep" -- string, regular expression (grep-like) 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
  - "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
 

global DisplaySimple (string file) -> void

Display specified file, list 100 lines

Parameters:
file string filename of file with the log

global DisplayFiltered (string file, string grep) -> void

Display log with filtering with 100 lines

Parameters:
file string filename of file with the log
grep string regular expression to be grepped in file

YaST2 Developers Documentation