Setting logger in CLI tasks #1455
-
Usage InformationNuke: 9.0.1, .net9.0, windows DescriptionWe just upgraded to Nuke 9.0.1 and logging is moving towards an attribute based system. In the upgrade to Nuke 9.0.1, the ToolOptions extension "SetProcessLogger" is marked as obsolete (To be removed), and the DockerTasks.DockerLogger has been removed. What is the preferred way to deescalate tools that log to the error stream even though the outcome is successful? Could the FAQ be updated for the tools that are notoriously logging to the error stream while the outcome is still successful? I apologize if this isn't a bug, I wasn't sure how to categorize this. Reproduction Steps
(Above raises an obsolete message, but cannot add attributes to class outside of assembly) Expected BehaviorKnow how to override the Logger after "SetProcessLogger" is removed. The FAQ has been updated with the preferred way to address this problem. Actual BehaviorWe do not know how to override the logger correctly. Regression?8.1.4 Known WorkaroundsContinue to use the SetProcessLogger method, use the command line tool instead? Could you help with a pull-request?No |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
How to handle the case where I want to ignore some log lines e.g. in a dotnet publish command (publishing a windows app), per default tries to invoke the tool if (msg.Contains("warning : Path to `mspdbcmf.exe` could not be found.", StringComparison.Ordinal))
return; |
Beta Was this translation helpful? Give feedback.
-
I'd appreciate it if everyone could share their specific use-cases. I.e., for which tool you need to set a custom logger, and what messages you're trying to change severity / skip completely. From all I know, there's a high chance that a bunch of these should be built-in so everyone benefits from the parsing knowledge. I'm aware that others, like PowerShell invocations with custom scripts, are a very different topic. I need more ground to make a decision, so far the obsoletion was just to ring some bells. |
Beta Was this translation helpful? Give feedback.
-
I think the problem arises from the fact that a lot of tools write also warning and informative messages to stderr. It is a very common practice among modern tooling and Nuke picks it up as error logs. Unfortunately there is not really an agreed standard to differenciate different severity levels on stdout/stderr. Just to name a few which are also built-into nuke:
My usecase goes a bit beyond just redirecting the logs but I actually want to react on the outputs of these tools. Depending on the output of the tool I take decision if the "error messages" are neglectable or not. Beside changing the severity for some specific messages, I also take later decision if the failed execution is a pipeline error or not. Some example use-cases are:
Beside the While I would definitely appreaciate also some additional out-of-the-box output and exit code handling I also see the strong need of being able to customize when needed. I understand your wish to get improvements directly into Nuke, but expecting everyone to provide concrete use-cases and/or contribute concrete changes to Nuke is not really a user-friendly approach. IMO Similarly the replacement of |
Beta Was this translation helpful? Give feedback.
I'd appreciate it if everyone could share their specific use-cases. I.e., for which tool you need to set a custom logger, and what messages you're trying to change severity / skip completely. From all I know, there's a high chance that a bunch of these should be built-in so everyone benefits from the parsing knowledge. I'm aware that others, like PowerShell invocations with custom scripts, are a very different topic.
I need more ground to make a decision, so far the obsoletion was just to ring some bells.