lsc icon indicating copy to clipboard operation
lsc copied to clipboard

posthook don't log script errors

Open davidcoutadeur opened this issue 1 year ago • 3 comments

Currently, posthook don't log script errors (see https://lsc-project.org/documentation/latest/syncrules.html#hooks-lsc-tasks-task-propertiesbasedsyncoptions-hooks)

It could be nice to log script stderr (and maybe also stdout?)

We need to check if this has an impact on performances

davidcoutadeur avatar Jan 19 '24 09:01 davidcoutadeur

I have a suggestion: have different levels for STDOUT and STDERR.

Seems easy to add an option in printHookOutput to set the logback level. I would choose DEBUG or INFO for STDOUR and ERROR for STDERR, instead of having WARN for both.

What do you think @davidcoutadeur ?

coudot avatar Jul 09 '24 12:07 coudot

Why not, it does not seem too difficult indeed.

Note: until know, the script were not supposed to write things to stdout/stderr, we should update the documentation:

Hook scripts are not supposed to write anything to stdout or stderr. If so, LSC will display theses messages as log warnings.

davidcoutadeur avatar Jul 09 '24 13:07 davidcoutadeur

Done in commit 40d80fe2

I have set level INFO for stdout and ERROR for stderr

I am updating the corresponding documentation right now.

davidcoutadeur avatar Jul 12 '24 17:07 davidcoutadeur