File SMLogger.mys
Logging utility, prints informations or error to console and log file.
You can choose the levels to print, i.e. only warnings and errors and ignore infos and debug.
In Harmony > 9.9.6c, the level is automatically set to info or debug if you run the script from the menu or the editor.
Summary
Constant | Type | Summary |
---|---|---|
LOG_FILE | string | Output also in a file? |
LOG_LEVEL | int | Logging level for your script |
LOG_LEVEL_DEBUG | int | Logging level: debug |
LOG_LEVEL_ERROR | int | Logging level: error |
LOG_LEVEL_INFO | int | Logging level: info |
LOG_LEVEL_TRACE | int | Logging level: trace, a more detailled debug |
LOG_LEVEL_WARN | int | Logging level: warning |
Return type | Function and summary |
---|---|
debug(string text) Log debugging informations. | |
err(string text) Log error This print "ERROR "..text to the console. | |
info(string text) Log informations. | |
trace(string text) Log trace-debugging informations. | |
warn(string text) Log warning This print "WARN "..text to the console. |
Constants
string LOG_FILE
Output also in a file?
Set LOG_FILE to a filename if you want so. Log lines older than 30 days are automatically deleted to avoid endless growth of the file.
int LOG_LEVEL_TRACE
Logging level: trace, a more detailled debug
int LOG_LEVEL_DEBUG
Logging level: debug
int LOG_LEVEL_INFO
Logging level: info
int LOG_LEVEL_WARN
Logging level: warning
int LOG_LEVEL_ERROR
Logging level: error
int LOG_LEVEL
Logging level for your script
Functions
trace(string text)
Log trace-debugging informations.
This allow you to keep logging in your script, even if shared with Myriad community.
This print "TRACE "..text
to the console.
If you often use print and comment all these prints before sharing, this will save you time!
Parameter | Type | Default | Description |
---|---|---|---|
text | string |
debug(string text)
Log debugging informations.
This allow you to keep logging in your script, even if shared with Myriad community.
This print "DEBUG "..text
to the console.
If you often use print and comment all these prints before sharing, this will save you time!
Parameter | Type | Default | Description |
---|---|---|---|
text | string |
info(string text)
Log informations.
This print "INFO "..text
to the console.
Parameter | Type | Default | Description |
---|---|---|---|
text | string |
warn(string text)
Log warning This print "WARN "..text
to the console.
Parameter | Type | Default | Description |
---|---|---|---|
text | string |