2.7 KiB
title | page_title | description | previous_url | slug | tags | published | position |
---|---|---|---|---|---|---|---|
Profiler Log And Trace | Profiler Log And Trace | JustMock Documentation | Profiler Log And Trace | /advanced-usage-profiler-log-and-trace.html | justmock/advanced-usage/profiler-log-and-trace | log,trace,profiler | True | 21 |
Profiler Log And Trace
In this article you will get familiar with Telerik JustMock Profiler built-in log and trace capabilities. Elevated mocking is strongly relies on profiler and sometimes it might be blocked by unexpected behavior which is hard to be troubleshooted. Here comes the profiler trace, it is really useful for finding where the problem comes from.
Enabling the Profiler Log And Trace
The log and trace functionality is controlled entirely via environment using dedicated variable JUSTMOCK_LOG_LEVEL. Possible values are: TRACE, DEBUG, INFO, WARN, ERROR, CRITICAL and OFF. Values from TRACE to CRITICAL enable tracing with different verbosity level in descending order, while OFF completely disables it. All traces are redirected to system debug output.
Inspecting the Profiler traces
System debug could be visualized without debugger by using DebugView. The typical output from the tool look like as following:
Keep in mind that the tool captures the output from whole system, so for convenience the traces could be filtered by the keyword JustMockProfiler.
Tip!
The traces inside DebugView window can be redirected to a file for further offline analysis.
Let's follow up an example, showing how the profiler trace can be enabled while executing test container from the command prompt step by step:
- Setting up profiler trace level using environment variable
set JUSTMOCK_LOG_LEVEL=DEBUG
- Launch DebugView and make sure that 'Capture Win32' and 'Capture Events' options are enabled
-
Setup filter in DebugView with keyword JustMockProfiler
-
Launch test execution in elevated (advanced) mode. The easiest way to achieve that is to use Telerik.JustMock.Console
"C:\Program Files (x86)\Progress\Telerik JustMock\Libraries\Telerik.JustMock.Console.exe" --profiler-path-32="C:\Program Files (x86)\Progress\Telerik JustMock\Libraries\CodeWeaver\32\Telerik.CodeWeaver.Profiler.dll" --command="vstest.console.exe" --command-args="bin\Debug\net45\UnitTestProject.dll"
- Profiler traces will start to appear inside DebugView window