How to start a new line of text within $$$LOGINFO or $$$TRACE?
Hi everyone,
Today I have a simple yet potentially valuable question: How can I begin a new line of text within $$$LOGINFO
or $$$TRACE
?
For instance, if I need to display a long log message within the visual trace, is it possible to do something like this:
$$$LOGINFO("object: 'This is a try'"
_"this is the second line with an example parameter: "_x
_"this is the third line with an example parameter: "_y
")
ObjectScriptObjectScript
Does anyone know if such a feature exists? It has the potential to greatly enhance code readability and layout.
Thanks :)
Product version: IRIS 2021.1
hopefully this is what you mean. $$$LOGINFO("this is the first line "_$c(13,10)_"this is second line"_$c(13,10)_" this is third line")
Hi Ian,
Thank you for your response. Maybe I expressed wrong and I apologize for any confusion, but I did not intend to start a new line within the log that is printed in the Visual Trace. Instead, I wanted to start a new line within VSC in order to avoid writing long one-line logs in the visual interface of VSC.
For example, I am looking for a way to transform this line of code:
$$$LOGINFO("this is the first line "_$c(13,10)_"this is second line"_$c(13,10)_" this is third line")
Into something like that, to improve code readability:
$$$LOGINFO("this is the first line " _$c(13,10)_"this is second line" _$c(13,10)_" this is third line")
You could add $char(13,10) or $$$NL ( this also refer $c(13,10) ) macro to make a new line
$$$LOGINFO("object: 'This is a try'"_$$$NL_"this is the second line with an example parameter: "_$get(x)_$$$NL_"this is the third line with an example parameter: "_$get(y))
Hi Ashok,
Thank you for your response. As I said to Ian, maybe I expressed wrong and I apologize for any confusion, but I did not intend to start a new line within the log that is printed in the Visual Trace. Instead, I wanted to start a new line within VSC in order to avoid writing long one-line logs in the visual interface of VSC.
For example, I am looking for a way to transform this line of code:
$$$LOGINFO("this is the first line "_$c(13,10)_"this is second line"_$c(13,10)_" this is third line")
Into something like that, to improve code readability:
$$$LOGINFO("this is the first line " _$c(13,10)_"this is second line" _$c(13,10)_" this is third line")
The syntax of $$$LOGINFO won't allow you make it in multiple lines. Instead you can set it in local variable and pass the variable in LOGINFO for better visibility
set log= "object: 'This is a try'" _"this is the second line with an example parameter: "_$get(x,1) _"this is the third line with an example parameter: "_$get(y,5) $$$LOGINFO(log)
Thanks! This is what I was looking for, it's a good idea.