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.

Functions

CSK_Logger.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()
CSK_Logger.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()
CSK_Logger.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()
CSK_Logger.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()
CSK_Logger.reloadLogsInUI()
Short description

Function to reload logfile to show in UI.

Sample (auto-generated)
CSK_Logger.reloadLogsInUI()
CSK_Logger.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)
CSK_Logger.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)
CSK_Logger.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.
It can make sense to set it to FALSE if e.g. "FileSink" is active as this will reduce the internal needed processing load to only focus on the FileSink, but then no log messages will be forwarded via "OnNewMessage"-event or shown in UI by this module.

Sample (auto-generated)
CSK_Logger.setCallbackSinkActive(status)
CSK_Logger.setConsoleSinkEnabled()
Short description

Set status of console sink.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_Logger.setConsoleSinkEnabled(status)
CSK_Logger.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)
CSK_Logger.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)
CSK_Logger.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)
CSK_Logger.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)
CSK_Logger.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)
CSK_Logger.setLogLevel()
Short description

Set log level.

Parameters
Name Type Multiplicity Description

level

ENUM
CSK_Logger.LogLevel

1

Log level

Sample (auto-generated)
CSK_Logger.setLogLevel(level)
CSK_Logger.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

CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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")
CSK_Logger.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.

Items
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.