winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

TraceLogging.h (3039B)


      1 // Copyright (c) Microsoft Corporation. All rights reserved.
      2 // Licensed under the MIT License. See LICENSE in the project root for license information.
      3 
      4 #pragma once
      5 
      6 #include <Telemetry/WinEventLogLevels.h>
      7 #include <TraceLoggingProvider.h>
      8 
      9 #include <Telemetry/MicrosoftTelemetry.h>
     10 
     11 // Keywords
     12 #define KEYWORD_REPEATER         0x0000000000000001
     13 #define KEYWORD_SCROLLER         0x0000000000000002
     14 #define KEYWORD_PTR              0x0000000000000004
     15 #define KEYWORD_SCROLLVIEWER     0x0000000000000008
     16 #define KEYWORD_SWIPECONTROL     0x0000000000000010
     17 #define KEYWORD_COMMANDBARFLYOUT 0x0000000000000020
     18 
     19 // Common output formats
     20 #define TRACE_MSG_METH L"%s[0x%p]()\n"
     21 #define TRACE_MSG_METH_DBL L"%s[0x%p](%lf)\n"
     22 #define TRACE_MSG_METH_DBL_DBL L"%s[0x%p](%lf, %lf)\n"
     23 #define TRACE_MSG_METH_DBL_INT L"%s[0x%p](%lf, %d)\n"
     24 #define TRACE_MSG_METH_DBL_DBL_INT L"%s[0x%p](%lf, %lf, %d)\n"
     25 #define TRACE_MSG_METH_DBL_DBL_FLT L"%s[0x%p](%lf, %lf, %f)\n"
     26 #define TRACE_MSG_METH_DBL_DBL_STR L"%s[0x%p](%lf, %lf, %s)\n"
     27 #define TRACE_MSG_METH_FLT L"%s[0x%p](%f)\n"
     28 #define TRACE_MSG_METH_FLT_FLT L"%s[0x%p](%f, %f)\n"
     29 #define TRACE_MSG_METH_FLT_FLT_FLT L"%s[0x%p](%f, %f, %f)\n"
     30 #define TRACE_MSG_METH_FLT_FLT_FLT_FLT L"%s[0x%p](%f, %f, %f, %f)\n"
     31 #define TRACE_MSG_METH_FLT_FLT_STR_INT L"%s[0x%p](%f, %f, %s, %d)\n"
     32 #define TRACE_MSG_METH_INT L"%s[0x%p](%d)\n"
     33 #define TRACE_MSG_METH_INT_INT L"%s[0x%p](%d, %d)\n"
     34 #define TRACE_MSG_METH_PTR L"%s[0x%p](0x%p)\n"
     35 #define TRACE_MSG_METH_PTR_PTR L"%s[0x%p](0x%p, 0x%p)\n"
     36 #define TRACE_MSG_METH_PTR_DBL L"%s[0x%p](0x%p, %lf)\n"
     37 #define TRACE_MSG_METH_PTR_INT L"%s[0x%p](0x%p, %d)\n"
     38 #define TRACE_MSG_METH_PTR_STR L"%s[0x%p](0x%p, %s)\n"
     39 #define TRACE_MSG_METH_STR L"%s[0x%p](%s)\n"
     40 #define TRACE_MSG_METH_STR_STR L"%s[0x%p](%s, %s)\n"
     41 #define TRACE_MSG_METH_STR_DBL L"%s[0x%p](%s, %lf)\n"
     42 #define TRACE_MSG_METH_STR_FLT L"%s[0x%p](%s, %f)\n"
     43 #define TRACE_MSG_METH_STR_INT L"%s[0x%p](%s, %d)\n"
     44 #define TRACE_MSG_METH_STR_STR_STR L"%s[0x%p](%s, %s, %s)\n"
     45 #define TRACE_MSG_METH_STR_INT_INT L"%s[0x%p](%s, %d, %d)\n"
     46 #define TRACE_MSG_METH_STR_FLT_FLT L"%s[0x%p](%s, %f, %f)\n"
     47 #define TRACE_MSG_METH_STR_STR_FLT L"%s[0x%p](%s, %s, %f)\n"
     48 #define TRACE_MSG_METH_STR_STR_INT_INT L"%s[0x%p](%s, %s, %d, %d)\n"
     49 
     50 #define TRACE_MSG_METH_METH L"%s[0x%p] - calls %s()\n"
     51 #define TRACE_MSG_METH_METH_INT L"%s[0x%p] - calls %s(%d)\n"
     52 #define TRACE_MSG_METH_METH_STR L"%s[0x%p] - calls %s(%s)\n"
     53 #define TRACE_MSG_METH_METH_STR_STR L"%s[0x%p] - calls %s(%s, %s)\n"
     54 #define TRACE_MSG_METH_METH_FLT_STR L"%s[0x%p] - calls %s(%f, %s)\n"
     55 #define TRACE_MSG_METH_METH_FLT_FLT_FLT L"%s[0x%p] - calls %s(%f, %f, %f)\n"
     56 
     57 // Current method name
     58 #define METH_NAME StringUtil::Utf8ToUtf16(__FUNCTION__).c_str()
     59 
     60 // TraceLogging provider name for telemetry.
     61 #define TELEMETRY_PROVIDER_NAME "Microsoft.Management.Configuration"
     62 
     63 TRACELOGGING_DECLARE_PROVIDER(g_hTraceProvider);
     64 extern bool g_IsTelemetryProviderEnabled;
     65 extern UCHAR g_TelemetryProviderLevel;
     66 extern ULONGLONG g_TelemetryProviderMatchAnyKeyword;