Hog v10.38.0
Logger.tcl File Reference

Go to the source code of this file.

Namespaces

 Hog::LoggerLib
 

Functions

 setDebugMode mode
 
 getDebugMode
 
 printDebugMode
 
 dictSafeGet d args
 Safely get a value from a dictionary. More...
 
 NotifyEnabled
 Check if desktop notifications have been enabled by the user. More...
 
 NotifyUrgency level
 Map a Hog severity level onto a notification urgency. More...
 
 Notify level message ?title?
 Send a desktop notification on Linux through the notify-send helper. More...
 
 Msg level fmsg ?title?
 The Hog Printout Msg function. More...
 
 MsgAndLog msg ?severity? ?outFile?
 Prints a message with selected severity and optionally write into a log file. More...
 
 Logo ?repo_path?
 
 PrintFileContent filename
 
 PrintFileTree data repo_path ?indentation?
 
 Hog::LoggerLib::GetUserFilePath filename
 gets the full path to the file in the user home folder More...
 
 Hog::LoggerLib::ParseTOML toml_file
 Parse a TOML format file and return the data as a dictionary. More...
 
 Hog::LoggerLib::ParseTOMLValue value
 Parse a TOML value and convert it to appropriate TCL type. More...
 
 Hog::LoggerLib::GetTOMLValue toml_dict key_path
 Get a value from a TOML dictionary using dot notation. More...
 
 Hog::LoggerLib::PrintTOMLDict toml_dict ?indent?
 Print a TOML dictionary in a readable format. More...
 
 Hog::LoggerLib::GetTOMLDict
 Access the dictionary of the parsed TOML file. More...
 

Function Documentation

◆ dictSafeGet()

dictSafeGet   d args  

Safely get a value from a dictionary.

Parameters
[in]dThe dictionary to search
[in]argsThe keys to look for

Definition at line 45 of file Logger.tcl.

◆ getDebugMode()

getDebugMode

Definition at line 27 of file Logger.tcl.

◆ Logo()

Logo   ?repo_path?  

Definition at line 251 of file Logger.tcl.

◆ Msg()

Msg   level fmsg ?title?  

The Hog Printout Msg function.

Parameters
[in]levelThe severity level (status, info, warning, critical, error, debug)
[in]msgThe message to print
[in]titleThe title string to be included in the header of the message [Hog:$title] (default "")

Definition at line 157 of file Logger.tcl.

◆ MsgAndLog()

MsgAndLog   msg ?severity? ?outFile?  

Prints a message with selected severity and optionally write into a log file.

Parameters
[in]msgThe message to print
[in]severityThe severity of the message
[in]outFileThe path of the output logfile

Definition at line 232 of file Logger.tcl.

◆ Notify()

Notify   level message ?title?  

Send a desktop notification on Linux through the notify-send helper.

Notifications are opt-in: nothing is sent unless the HOG_NOTIFY environment variable is enabled, see NotifyEnabled.

the helper is run detached and silenced: a notification that cannot be delivered, for example over ssh or with no notification daemon running, is dropped without interrupting the build.

Parameters
[in]levelThe severity level, in any of the forms accepted by Msg
[in]messageThe body of the notification
[in]titleThe title of the notification (default "Hog <level>")

Definition at line 113 of file Logger.tcl.

◆ NotifyEnabled()

NotifyEnabled

Check if desktop notifications have been enabled by the user.

Notifications are opt-in and controlled by the HOG_NOTIFY environment variable, which may be set to 1, true, yes, on or enabled.

Returns
1 if notifications are enabled, 0 otherwise

Definition at line 71 of file Logger.tcl.

◆ NotifyUrgency()

NotifyUrgency   level  

Map a Hog severity level onto a notification urgency.

Parameters
[in]levelThe name of the severity level, as passed to Msg
Returns
one of "low", "normal" or "critical"

Definition at line 85 of file Logger.tcl.

◆ printDebugMode()

printDebugMode

Definition at line 32 of file Logger.tcl.

◆ PrintFileContent()

PrintFileContent   filename  

Definition at line 301 of file Logger.tcl.

◆ PrintFileTree()

PrintFileTree   data repo_path ?indentation?  

Print a tree-like structure of Hog list file content

Parameters
[in]datathe list of lines read from a list file
[in]repo_paththe path of the repository
[in]indentationa string containing a number of spaces to indent the tree

Definition at line 322 of file Logger.tcl.

◆ setDebugMode()

setDebugMode   mode  

Definition at line 22 of file Logger.tcl.