Hello all,
I hope this is the correct location to post this. If not please excuse me and move this to the right location.
There is a bug in the FlowElement logger:
Whenever I use a % sign in the log, the logger gives an error: 'Invalid placeholders in log message'.
Some url's (for example S3 presigned url's) need to use % in the url, so it would be valid behaviour to allow this in the log message in my opinion.
Kind regards,
Thomas
[Bug] logger fails to log message with %
Re: [Bug] logger fails to log message with %
The % signs are intended to be used as placeholders for variables. This is mainly used to do logging in different languages.
You can find more information on the intended behavior in the documentation:
https://www.enfocus.com/manuals/Develop ... sages.html
I don't use translations so I usually do logging like this:
This way it searches for the placeholders and replaces them with the placeholders. The end result is successful logging with % signs in the string.
That being said, I did ask Enfocus Support to log a feature request that if there is no array with replacements used, that the logging function does not try to do replacements and just accepts strings with % in them. Feel free to report the same to Enfocus Support, the more people that report it, the bigger the chance it gets implemented.
You can find more information on the intended behavior in the documentation:
https://www.enfocus.com/manuals/Develop ... sages.html
I don't use translations so I usually do logging like this:
Code: Select all
await job.log(LogLevel.Warning, 'Something takes longer for job %1 with name "%2" ',['%1', '%2', '%3', '%4', '%5', '%6', '%7', '%8', '%9', '%10' ])
That being said, I did ask Enfocus Support to log a feature request that if there is no array with replacements used, that the logging function does not try to do replacements and just accepts strings with % in them. Feel free to report the same to Enfocus Support, the more people that report it, the bigger the chance it gets implemented.