Document metadata
Application name |
CSK_1stModule_Logger |
---|---|
Version |
4.2.1 |
Date |
2024-07-31 |
Author |
SICK AG |
Crowns
CSK_1stModule_Logger
Short description
This is an automatically generated CROWN (description not necessary).
CSK_Logger
Short description
Module to provide logger functionality to log / store messages of all other CSK modules.
Check the CSK documentation which explains, how to use this logger by other apps: https://github.com/SICKAppSpaceCodingStarterKit/.github/blob/main/docu/SICKAppSpaceCodingStarterKit_Documentation.md#structure
Maybe the name of this module needs to be adapted to run first and also to log messages of the global scopes.
Check UI of this module for most available features.
INFO: If using the "FileSink" feature, a SD card should be used to reduce write accesses on the internal flash storage of the device.
Overview
Functions
getParameters()
Short description
Function to get all parameters of the client in JSON format.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
jsonParameters |
STRING |
1 |
JSON string with all parameters. |
Sample (auto-generated)
jsonParameters = CSK_Logger.getParameters()
getStatusModuleActive()
Short description
Function to get status if module is active.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
status = CSK_Logger.getStatusModuleActive()
loadParameters()
Short description
Load parameters for this module from the CSK_PersistentData module if possible and use them.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
success |
BOOL |
1 |
Success to load parameters. |
Sample (auto-generated)
success = CSK_Logger.loadParameters()
pageCalled()
Short description
Function to register "OnResume" of the module UI (only as helper function).
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
empty |
STRING |
1 |
Empty string (only needed to simplify binding). |
Sample (auto-generated)
empty = CSK_Logger.pageCalled()
reloadLogsInUI()
Short description
Function to reload logfile to show in UI.
Sample (auto-generated)
CSK_Logger.reloadLogsInUI()
sendParameters()
Short description
Send parameters to CSK_PersistentData module if possible to save them.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
noDataSave |
BOOL |
? |
[Optional] Set to TRUE if the data should NOT be saved immediately after sending. |
Sample (auto-generated)
CSK_Logger.sendParameters(noDataSave)
setAttachToEngineLogger()
Short description
Set status if logger should attach to engine logger.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_Logger.setAttachToEngineLogger(status)
setCallbackSinkActive()
Short description
Function to configure if internal callback sink should be used to process incoming log messages.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Is TRUE per default to process incoming log messages. |
Sample (auto-generated)
CSK_Logger.setCallbackSinkActive(status)
setConsoleSinkEnabled()
Short description
Set status of console sink.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_Logger.setConsoleSinkEnabled(status)
setFileName()
Short description
Set name of the logging file.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
name |
STRING |
1 |
Filename |
Sample (auto-generated)
CSK_Logger.setFileName(name)
setFilePath()
Short description
Set path of the logging file.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
path |
STRING |
1 |
Filepath |
Sample (auto-generated)
CSK_Logger.setFilePath(path)
setFileSinkActive()
Short description
Set status of file sink of the log.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_Logger.setFileSinkActive(status)
setLoadOnReboot()
Short description
Configure if this module should load its saved parameters at app / device boot up.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_Logger.setLoadOnReboot(status)
setLogFileSize()
Short description
Set size of the log file in bytes before truncating.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
size |
INT |
1 |
Size in bites. Has to be in the range [1024,104857600] bytes. |
Sample (auto-generated)
CSK_Logger.setLogFileSize(size)
setLogLevel()
Short description
Set log level.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
level |
ENUM |
1 |
Log level |
Sample (auto-generated)
CSK_Logger.setLogLevel(level)
setParameterName()
Short description
Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
name |
STRING |
1 |
Name of the parameter. |
Sample (auto-generated)
CSK_Logger.setParameterName(name)
Events
OnDataLoadedOnReboot
Short description
Event to call if module tried to load parameters and should be ready.
Sample (auto-generated)
function handleOnDataLoadedOnReboot()
-- Do something
end
Script.register("CSK_Logger.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
OnNewCompleteLogfile
Short description
Notify all available log messages once.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
logfile |
STRING |
? |
Full temporary / stored logfile content. |
Sample (auto-generated)
function handleOnNewCompleteLogfile(logfile)
-- Do something
end
Script.register("CSK_Logger.OnNewCompleteLogfile", "handleOnNewCompleteLogfile")
OnNewFilename
Short description
Notify file name of the logging file.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
filename |
STRING |
1 |
Filename |
Sample (auto-generated)
function handleOnNewFilename(filename)
-- Do something
end
Script.register("CSK_Logger.OnNewFilename", "handleOnNewFilename")
OnNewFilepath
Short description
Notify path of the logging file.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
filepath |
STRING |
1 |
Path |
Sample (auto-generated)
function handleOnNewFilepath(filepath)
-- Do something
end
Script.register("CSK_Logger.OnNewFilepath", "handleOnNewFilepath")
OnNewFullFilePath
Short description
Notify full path of the logging file (path + name).
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
filepath |
STRING |
1 |
Full filepath (path + name). |
Sample (auto-generated)
function handleOnNewFullFilePath(filepath)
-- Do something
end
Script.register("CSK_Logger.OnNewFullFilePath", "handleOnNewFullFilePath")
OnNewLogfileSize
Short description
Notify max size of ligfile in bytes.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
size |
INT |
1 |
Size |
Sample (auto-generated)
function handleOnNewLogfileSize(size)
-- Do something
end
Script.register("CSK_Logger.OnNewLogfileSize", "handleOnNewLogfileSize")
OnNewLogLevel
Short description
Notify log level to use.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
level |
STRING |
1 |
Level to log. |
Sample (auto-generated)
function handleOnNewLogLevel(level)
-- Do something
end
Script.register("CSK_Logger.OnNewLogLevel", "handleOnNewLogLevel")
OnNewMessage
Short description
Notify latest received logging message.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
message |
STRING |
1 |
Logging message |
Sample (auto-generated)
function handleOnNewMessage(message)
-- Do something
end
Script.register("CSK_Logger.OnNewMessage", "handleOnNewMessage")
OnNewParameterName
Short description
Notify name of persistent data parameter.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
name |
STRING |
1 |
Parameter name |
Sample (auto-generated)
function handleOnNewParameterName(name)
-- Do something
end
Script.register("CSK_Logger.OnNewParameterName", "handleOnNewParameterName")
OnNewStatusAttachedToEngineLogger
Short description
Notify status to attach logger to engine logger.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusAttachedToEngineLogger(status)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusAttachedToEngineLogger", "handleOnNewStatusAttachedToEngineLogger")
OnNewStatusCallbackSink
Short description
Notify status if the internal callbackSink for log messages is active.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusCallbackSink(status)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusCallbackSink", "handleOnNewStatusCallbackSink")
OnNewStatusConsoleSink
Short description
Notify status of console sink.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusConsoleSink(status)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusConsoleSink", "handleOnNewStatusConsoleSink")
OnNewStatusCSKStyle
Short description
Notify UI style to use for CSK modules.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
theme |
STRING |
1 |
UI style |
Sample (auto-generated)
function handleOnNewStatusCSKStyle(theme)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
OnNewStatusFileSinkActive
Short description
Notify status of file sink.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusFileSinkActive(status)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusFileSinkActive", "handleOnNewStatusFileSinkActive")
OnNewStatusLoadParameterOnReboot
Short description
Notify status if parameters should be loaded on app / device boot up.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusLoadParameterOnReboot(status)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
OnNewStatusModuleIsActive
Short description
Notify if module can be used on device.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusModuleIsActive(status)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
OnNewStatusModuleVersion
Short description
Notify version of module.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
version |
STRING |
1 |
Version |
Sample (auto-generated)
function handleOnNewStatusModuleVersion(version)
-- Do something
end
Script.register("CSK_Logger.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
OnPersistentDataModuleAvailable
Short description
Notify status if features of CSK_PersistentData module are available.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnPersistentDataModuleAvailable(status)
-- Do something
end
Script.register("CSK_Logger.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
OnUserLevelAdminActive
Short description
Status of Admin userlevel. Used internally in combination with the CSK_UserManagement module if available.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnUserLevelAdminActive(status)
-- Do something
end
Script.register("CSK_Logger.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
OnUserLevelMaintenanceActive
Short description
Status of Maintenance userlevel. Used internally in combination with the CSK_UserManagement module if available.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status of Maintenance userlevel. |
Sample (auto-generated)
function handleOnUserLevelMaintenanceActive(status)
-- Do something
end
Script.register("CSK_Logger.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
OnUserLevelOperatorActive
Short description
Status of Operator userlevel. Used internally in combination with the CSK_UserManagement module if available.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status of Operator userlevel. |
Sample (auto-generated)
function handleOnUserLevelOperatorActive(status)
-- Do something
end
Script.register("CSK_Logger.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
OnUserLevelServiceActive
Short description
Status of Service userlevel. Used internally in combination with the CSK_UserManagement module if available.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
STRING |
1 |
Status of Service userlevel. |
Sample (auto-generated)
function handleOnUserLevelServiceActive(status)
-- Do something
end
Script.register("CSK_Logger.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")
Enumerations
CSK_Logger.LogLevel
Level of messages to log.
Value | Name | Description |
---|---|---|
ALL |
ALL |
Log all messages. |
OFF |
OFF |
Log nothing. |
INFO |
INFO |
Log infos, warnings and severe errors. |
SEVERE |
SEVERE |
Log only severe errors. |
WARNING |
WARNING |
Log warnings and severe errors. |
FINEST |
FINEST |
Log finest, finer, fine, infos, warnings and severe errors. |
FINER |
FINER |
Log finer, fine, infos, warnings and severe errors. |
FINE |
FINE |
Log fine, infos, warnings and severe errors. |