Unity Debug without the linenumber - debugging

I am developing an application for the Hololens using unity,. And sometimes (since still in Debug not Release stage) I print debug statements using Debug.Log.
However, everytime I use that, I got my custom message and the following:
(Filename: C:/buildslave/unity/build/artifacts/generated/Metro/runtime/DebugBindings.gen.cpp Line: xx)
I don't know what this means, but it clutters the debug output. Is there any way to use the debug messages of the UnityEngine without these?

Related

Execute some piece of code only on Debug mode in Cypress

is there any way to set Debug more in cypress and
run certain parts of code only in Debug mode in Cypress
I am looking for something similar like #if DEBUG in C#
For Example
I want to run log only in debug more so that I can save execution time when It's running normally

How to have a wxButton destroy itself?

I have a wxButton in my window which I'm binding with the following:
BitmapButton1->Bind(wxEVT_BUTTON, [=](wxCommandEvent& e)
{
if(TextCtrl1)
OptionsSizer->Detach(TextCtrl1);
if(Choice1)
OptionsSizer->Detach(Choice1);
if(BitmapButton1)
OptionsSizer->Detach(BitmapButton1);
if(TextCtrl1)
TextCtrl1->Destroy();
if(Choice1)
Choice1->Destroy();
if(BitmapButton1)
BitmapButton1->Destroy();
OptionsSizer->Layout();
OptionsWindow->SetSizer(OptionsSizer);
SendSizeEvent();
}, bId);
The idea is that when the button is clicked it deletes itself as well as a couple of other controls. The above however crashes. I've tried debugging but the debugger seems unable to pick up my breakpoints (something I've found common with wxWidgets).
After the lambda is executed the original pointers will be dangling, with incorrect, not-NULL values. Are they used anywhere else too?
In general, you'd need to provide more info for such a question, like more code, the stack trace, the type of build - you'd obviously need debug build in order to debug it, right?
the debugger seems unable to pick up my breakpoints (something I've found common with wxWidgets)
There is no such thing as wxWidgets preventing the debugger from hitting breakpoints in a debug build. Do make sure you are using the debug build - something I've found common with people with such issues.

Filter Debug statements in the Output Window

I'm finding my Output Window's content quite unpleasant to use, as the window is about 90% full of debug lines from IIS Express and from Application Insights. Ideally I would like to filter the Debug sources that write to that window, but maybe I can configure either source to not write so much debug data, e.g. maybe set a higher minimum level like Error vs. what looks like Trace, or at least Info.
What can I do so I can more easily see my own debug statements and important stuff, like WPF binding errors?
I've found an excellent solution for most unwanted info in the Output Window in this answer, but there is still a lot of clutter from ApplicationInsights. Is there no way to configure this locally to only write at level Error?
there's no error level concept for ApplicationInsights output all up (some things like custom events, metrics, etc, don't have the concept of an error level).
if you want to disable the output, you can either set DeveloperMode to false, or use TelemetryDebugWriter.IsTracingDisabled = true; to disable output.
(disabling output will make any of the application insights tools in visual studio while debugging no longer function, though. the AI VS extension is watching the output window for those events to power content in Diagnostics Tools window, debug search, and local CodeLens scenarios)

How do prevent "Debug Error!" window from appearing?

I have a series of Google Unit Tests that are launched via a bat file. Some of these tests are broken and a window appears when they run:
Microsoft Visual C++ Debug Library
Debug Error!
... Info about error
This window waits for a user to press Abort, Retry, Ignore. Of course, this halts my test. Currently, I delete the broken tests before I run the batch. I want a way to force this window to abort or ignore - so I don't need to skip the broken tests.
This problem is similar to; however, I cannot write to reg keys
How do I disable the 'Debug / Close Application' dialog on Windows Vista?
Update: My manager says this window might not appear if this project was in release. Trying to do that now. However, if there is a solution besides changing my project to release, I would appreciate it! :D
That's what you get from a failed assert() in the source code. Useful to debug the test. But actually running unit tests against code that was compiled in the Debug configuration is not useful. Your customer isn't going to run the Debug build either.
Only test the Release build, that disables those assert() calls as well.

Debugger.Launch(), Trace.Assert(fail) not working

(Note, this question has been marked answered in Debugging Sharepoint timer jobs but I'm still having trouble)
I'm unable to debug my SharePoint timer job. Usually I can do this by setting one of these:
Debugger.Launch()
Trace.Assert(false)
But a dialog is not shown. I have a log4net OutputDebugStringAppender so that I can use DebugView to monitor output, and I can see that DEBUG ASSERTION FAILED is being written to the debug log. I've tried removing the appender in case it might mess up something, but with no luck.
(Rebuild, restart, IIS reset, Service reset, pdb files in assembly is done)
So why is a dialog not shown? I could really use some help with debugging this timer job and would be very thankful for any ideas.
You are most probably running your app in Debug mode instead of Release mode. In debug mode you already have Debugger attached so it won't launch.
You can find if debugger is attached or not by this:
System.Diagnostics.Debugger.IsAttached
So try like this:
if(!System.Diagnostics.Debugger.IsAttached)
{
System.Diagnostics.Debugger.Launch();
}
Trace.Assert(false)//Trace is not bound to Debug or Release mode so will always run

Resources