You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of 4102c79 the specification for logMessage is lacking in detail on how to parse the attribute
If this attribute exists and is non-empty, the backend must not 'break' (stop) but log the message instead. Expressions within {} are interpolated.
For some languages it is quite normal for expressions to include the { and } delimiters, in Perl for instance you might want to log
Value of key field in hash is {$hash{key}} # ?
I would expect either \-escaping or actually configurable delimiters. For Perl it might be better to use backticks instead of curly braces, for instance, in which case the specification should allow implementations to vary on that point.
The text was updated successfully, but these errors were encountered:
I could also imagine that simply skipping over balanced nested curly braces would work to extract the "expressions", given that expressions here should be fairly simple. So if you parse the template and hit { you continue looking for { and matching }s up until you found the } that matches the outermost {. But that too should be noted, then.
functionparseLogpointTemplate(template: string){constparts: string[][]=[[]];letdepth=0;for(consttokenoftemplate.match(/(\{|\}|[^{}]+)/g)){if(token==='{'){if(depth++===0){parts.push([]);}parts[parts.length-1].push(token);}elseif(token==='}'){parts[parts.length-1].push(token);if(depth>0){depth--;if(!depth){parts.push([]);}}}else{parts[parts.length-1].push(token);}}returnparts.map(x=>x.join("")).map(x=>{returnx.startsWith('{')&&x.endsWith('}') ? {expr: x.substring(1,x.length-2).trim()} : {text: x}});}constparts=parseLogpointTemplate('this is { $h->{value}{value} } the value');
As of 4102c79 the specification for
logMessage
is lacking in detail on how to parse the attributeFor some languages it is quite normal for expressions to include the
{
and}
delimiters, in Perl for instance you might want to logI would expect either
\
-escaping or actually configurable delimiters. For Perl it might be better to use backticks instead of curly braces, for instance, in which case the specification should allow implementations to vary on that point.The text was updated successfully, but these errors were encountered: