Disabling logging with LogLevel.None not working - postsharp

I have a project where Log aspect is applied for method entry and exit.
LoggingServices.DefaultBackend = new PostSharp.Patterns.Diagnostics.Backends.Console.ConsoleLoggingBackend();
To disable log, I have the below statement but I still see method entry, exit (which are LogLevel with Trace) in log
LoggingServices.DefaultBackend.GetSource(LoggingRoles.Tracing).SetLevel(LogLevel.None);
But when I change the loglevel to critical as below, the method entry/exit is not logged.
LoggingServices.DefaultBackend.GetSource(LoggingRoles.Tracing).SetLevel(LogLevel.Critical);
Shouldn't the LogLevel.None suppress the entry/exit traces ?

The issue has been fixed in PostSharp 5.0.32.

Related

is there a way to disable a mega-detailed error message in Rundeck's failed executions?

The message that is posted every time an execution fails is too verbose and creates too much noise. Is there a way to disable or hide it somehow? We have our own error messages within the scripts and don't need a red chunk of extra text displayed in the logs. Adding an error handler that will exit with code 0 is not an option because we still need the job to fail if a step fails.
That message is Rundeck standard output in case of failure (you can manipulate the loglevel but that doesn't affect the NonZeroResultCode last line, just the text from your commands/scripts), you can suggest that here. The rest are just workarounds as you mentioned.
This occurs even using the Quiet output.

How to completely disable `client_min_messages` in Postgres?

The C-driver for Postgres prints NOTICE messages to STD output.
How it could be disabled? I'm using STD output for logs and these unexpected messages breaks log parsing.
There's client_min_messages parameter that controls the level of messages, but I need to completely disable it, so even errors shouldn't be printed.
Is there a way to do that? I'm using PostgreSQL 13.2
You could execute
SET client_min_messages = error;
to disable as many messages as possible. Note, however, that
INFO level messages are always sent to the client.
as the documentation says.
But it would be way better to set up a notice handling function as detailed in the documentation.

provideDebugConfigurations not getting called

I am using the vscode-mock-debug git as the basis for my work.
Activation event is OnDebug, although same result
I implement provideDebugConfigurations in my DebugConfigurationProvider and its not getting called.
provideDebugConfigurations(folder: WorkspaceFolder | undefined, token?: CancellationToken): DebugConfiguration[] {
return [...my data in here];
}
the resolveDebugConfiguration (the original from mock-debug) is called, I can set a breakpoint. However the provideDebugConfigurations is never getting reached. build 1.36 of vsce. am I missing something obvious ?
this is the answer from the vscode team: https://github.com/microsoft/vscode/issues/78362
I have investigated this and it is expected behavior.
Namely, provideDebugConfigurations is only called then the debug configurations are needed to generate a launch.jsonfile. If you click on the configure command the provideDebugConfigurations will get nicely called.
However if you do not have a launch.json and you simply press Debug Start, vscode will try to start debugging without using debug configurations, but using one on the fly provided by the resolveDebugConfiguration call.
More about this can be found in our docs https://code.visualstudio.com/api/extension-guides/debugger-extension
Thus closing this as designed.

How do I change Akka and Logback logging level

To change logging level to WARN, do I leave akka.conf to DEBUG:
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
event-handler-level = "DEBUG"
and change logback.xml to WARN? Or should I change both event-handler-level to WARN and logback.xml to WARN?
If I leave event-handler-level to DEBUG and logback.xml to WARN, my event bus would be over flooded with log events, no?
The event-handler-level determines what gets posted to the logger actors, and the Slf4jEventHandler will then faithfully forward everything to logback. If you know that the second step will then drop messages to the floor, it would be better to not generate them in the first place. Since the event handler does not distinguish different levels for different “message categories”, you need to set the event handler level to the lowest level your logback.xml is configured to emit.

Invoke process activity not logging any error in log file

I am trying to use Invoke process to invoke an executable from my windows workflow in my TFS 2010 build.
But when I am looking at the log file it is not logging any error.
I did use WriteBuildMessage and WriteBuildwarning inside my invoke process activity.
I also set the filename,workingdirectory etc in activity.
Can someone please point out why it is not logging?
You can do something like this:
In this case you have to ensure that Message are set as follows:
With those parameters set as depicted, I catch what you seem to be after.
Furthermore, you can check in the Properties of your InvokeProcess: Set the Result into a string-variable and then set in a subsequent WriteBuildMessage this string-variable to be the Message. This way, you 'll additionally catch the return of your invoked process.
EDIT
Another common thing that you 've possibly overlooked is the BuildMessageImportance: if it is not set as High, messages do NOT appear under default Logging Verbosity (= Normal). See here for some background.
In your Invoke Process, you want to set the Result property to update a variable (returns an Int, so lets call it ExitCode), under your Invoke Process (but still in the Agent Scope) you can drop in an If, so you can set the condition of this to ExitCode <> 0 and do whatever you like on a failure (such as failing the build).
Also, as a note, if your WriteBuildMessage is not showing anything in your log, you need to set the Importance to Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High, anything lower and it wont show in the Normal logging level.