why postsharp log level can only be changed once - postsharp

we are using the following codes in app_start to change log level dynamically by retrieving the log level from web.config.
LoggingServices.GetSource(LoggingRoles.Tracing).SetLevel(LogLevel.Debug));
after build, we change the log level to Error, we don't see debug level information anymore, but if we change it back to Debug, we still don't see the debug level information. If we set initial level to be Error, after rebuild, we don't any debug info, then change level to Debug, we see debug information, then we change it to Error, we still see debug information. the change of log level only work once.

The only cause I can see is that you have the AllowDynamicEnabling property set to false in your logging profile. See http://doc.postsharp.net/log-enabling#optimizing.
In other cases, you should be able to change the verbosity dynamically. We fixed a bug related to this a couple of months ago, so make sure you have a recent version.

Related

Launch Chromium with command line switches has no effect

I'm running Chromium 85 on macOS 10.15.3.
I'm trying to use some of the various command line switches that Chromium makes available and none of them seem to have any effect. For example
./Chromium --ignore-gpu-blacklist
When it launches and I go to the chrome://flags page, the setting has not been enabled:
I've tried this on multiple versions of Chromium as well as on Windows with the same results. I can't seem to enable any of them.
I did notice on this page that it says
Note that if you look at chrome://flags to see if the command line
option is active, the state might not be accurately reflected. Check
chrome://version for the complete command line used in the current
instance.
So maybe it is working and there's just no way to verify that? Checking the chrome://version page is not really sufficient to tell if a feature was successfully enabled. It's just echoing back what you passed into the command line.
As you noted, chrome://flags does not reflect the actual state. It only shows the flags that were enabled via that page. If you supply additional flags the page does not show them enabled, but they can still have an effect.
Try with
./Chromium --show-overdraw-feedback
and check the flags page. It will not show as enabled, but you can clearly see all the overlays everywhere.
So you can assume your original
./Chromium --ignore-gpu-blacklist
was likely correct and works.

hot swapped warning without making any changes (Spring tool suite 3.9)

When running my code in debug mode, I keep getting 2 error messages:
Could not delete [path_to]\productiondb.log. May be locked by another process
I don't know what process might be locking it. It comes when I make changes to the code while my Pivotal tc Server is running in debug mode, but it dosent seem to create a lot's of trouble. Sometimes however, I get this warning:
Also due to some changes. I usally just restart the server and move on. This isen't the real problem, the real problem is that I get these messages when I havent doen any changes. Somethimes it accures when I run a certen part of the code, other times i occurs when I open certen codes in sts, however, it doen't seem to stop at the same place twice.
I am suspecting that this has something to do with git. I am using git to change between versions and doing tests. So I am thinking that STS has some of the code in memory from before I changed branche with git, and isen't updating it before I run or open the file with that code. But I am rather new to both sts and git, and can't be certan that it would work that way. If it is, does anyone know how to update sts after I have changed branch? If it is not, does anyone know what might causing it?
If you run an app in debug mode, the Eclipse Debugger tells the application when code gets changed and tries to use the debug API to swap in the new code into the running application. This is especially useful if you debug your code, hit a breakpoint, step through the code, fit the issue, change the code, and press save. At that moment, the Eclipse compiler updates the class file and tells the running JVM to swap in the new code. If that succeeds, the debugger will jump back to the last stack frame and the execution of your app will continue with the beginning of the method that you entered. This allows you to directly continue to debug and step through the updated code without restarting the app.
While this is a great feature of the JVM, it is very limited in terms of what scope of changes to the classes the JVM can deal with while doing this hot-swap. It is usually limited to method implementations. So adding new methods, adding or deleting members of the class, etc, are not supported. As a result, the above screenshot will appear. It means that the JVM wasn't able to hot-swap the changed code and will continue to run with the previously loaded code instead of the changed one.

"Preserve log" in Chrome Console to see "Uncaught TypeError"?

When I uncheck "Preserve log" in the console settings, I don't see the error below. Why are they related?
When Preserve Log is enabled, the Console preserves messages until you explicitly clear it. When it's disabled, the Console clears messages on page loads.
So, it looks like there's some code that runs just before you navigate to a new page, and that code is throwing an error. So while the error technically does get displayed (for a split-second) in both scenarios, it's probably just getting erased before you can see it with your eyes when you have Preserve Log disabled.

More than just EXC_BAD_ACCESS?

Is there a more detailed error to be found other than the console's EXC_BAD_ACCESS? Where/how can I see it?
When my app crashes, I see the error in thE XCode status bar, but the console shows nothing else. Where do I see more info about what causes the crash?
The application will have a stack trace, typically in the crash logs. Definitely look there for a bit more detail. Look under ~/Library/Logs/CrashReporter for those details. In general, run the application "Console.app" in your Utilities folder, and click on the button "Show Log List". It gives a detailed view into all the logs available that you'd likely want to check out in your system
If it's code you have written, the debugger (gdb) is the "how" to go to look for more detail. That's typically a "you overreleased" some object if you're working in Objective-C. There's a good set of notes on using the technique "NSZombieEnabled" to find what you're blowing up on.

How do i stop XCode from having build errors repeatedly appear and disappear?

Very often, when I run my unit tests for my iPhone project, XCode feels like making the actual errors disappear from the errors and warnings group. These errors are often under the general sub-item of that group, and often when I need to read the text of the error in detail, all errors disappear and all I have left are the build warnings. Has anyone else seen this behavior and is there a way to fix it?
Edit: I forgot to mention; this seems to happen when i have errors that are not tied to any file (it says Line Location:0 in the second column of the error list). If there aren't any errors there (when generally the only errors are failed assertions) then it seems to work ok.
I haven't seen this behavior but what you describe sounds like a bug to me. You should submit it to apple.
It's hard to follow what you're talking about. What I can deduce is that you:
Build a Unit Test target
See the Errors and Warnings in an item in the Build Results window
Do something you don't explain to "read the text of the error in detail"
See the errors disappear (from the build results window?) but the warnings remain
It would help to see a screen shot of your project when it's doing what you want, before the errors disappear, and to learn what you are doing right before they go away.
This is probably happening because you have multiple targets with dependencies.
One target is dependent on another (usually unit tests) and the unit tests get built and their warnings/errors show up. Then, the main target gets built and its warning/errors show up. Since they are different targets, they second batch shows up over the first batch.
Assuming this is the problem, you can see the first batch by manually changing your target temporarily.