summaryrefslogtreecommitdiff
path: root/src/vm/clrtracelogging.cpp
blob: 64e572a10686e6be5621be5ad4ea6079eb079175 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

//*****************************************************************************
// clrttracelogging.cpp
// Telemetry Logging for clr.dll
//
//*****************************************************************************

#include "common.h"
#include "clrtracelogging.h"
#include "TraceLoggingProvider.h"
#include "MicrosoftTelemetry.h"

TRACELOGGING_DEFINE_PROVIDER(g_hClrProvider, CLR_PROVIDER_NAME, CLR_PROVIDER_ID, TraceLoggingOptionMicrosoftTelemetry());

// Used for initialization and deconstruction.
static CLRTraceLog::Provider g_clrTraceProvider(g_hClrProvider);

//--- CLRTraceLogProvider

// static
void CLRTraceLog::Logger::LogTargetFrameworkAttribute(LPCWSTR targetFrameworkAttribute, const char * assemblyName)
{
	STANDARD_VM_CONTRACT;
	
	EX_TRY
	{
		TraceLoggingWrite(g_hClrProvider,"CLR.AssemblyInfo",
		TraceLoggingWideString(targetFrameworkAttribute, "TARGET_FRAMEWORK_ATTRIBUTE"),
		TraceLoggingString(assemblyName, "ASSEMBLY_NAME"),
		TraceLoggingKeyword(MICROSOFT_KEYWORD_TELEMETRY));
	}
	EX_CATCH{}
	EX_END_CATCH(SwallowAllExceptions)
	
}
//--- CLRTraceLog