39 references to OutLn
Microsoft.Gen.Metrics (39)
Emitter.cs (26)
54
OutLn
($"namespace {nspace}");
116
OutLn
(parentTypes[i]);
121
OutLn
($"{metricType.Modifiers} {metricType.Keyword} {metricType.Name} {metricType.Constraints}");
190
OutLn
($"{accessModifier} sealed class {metricMethod.MetricTypeName}");
191
OutLn
($"{{");
192
OutLn
($" private readonly {typeDefinition} _{objectName};");
194
OutLn
($" public {metricMethod.MetricTypeName}({typeDefinition} {objectName})");
195
OutLn
($" {{");
196
OutLn
($" _{objectName} = {objectName};");
197
OutLn
($" }}");
206
OutLn
($" {{");
212
OutLn
($" if (!_{objectName}.Enabled)");
213
OutLn
($" {{");
214
OutLn
($" return;");
215
OutLn
($" }}");
221
OutLn
($" if (o == null)");
222
OutLn
($" {{");
223
OutLn
($" throw new global::System.ArgumentNullException(nameof(o));");
224
OutLn
($" }}");
232
OutLn
("var tagList = new global::System.Diagnostics.TagList");
236
OutLn
("};");
242
OutLn
($" _{objectName}.{recordStatement}(value{(tagListInit ? ", tagList" : string.Empty)});");
243
OutLn
($" }}");
244
OutLn
("}");
300
OutLn
($"new global::System.Collections.Generic.KeyValuePair<string, object?>(\"{tagName}\", {paramName}),");
322
OutLn
($"new global::System.Collections.Generic.KeyValuePair<string, object?>(\"{config.TagName}\", {access}),");
MetricFactoryEmitter.cs (10)
64
OutLn
($"namespace {nspace}");
69
OutLn
("internal static partial class GeneratedInstrumentsFactory");
109
OutLn
($"private static global::System.Collections.Concurrent.ConcurrentDictionary<{meterParam.Type}, {nsprefix}{metricMethod.MetricTypeName}>");
110
OutLn
($" {GetMetricDictionaryName(metricMethod)} = new();");
145
OutLn
($"{accessModifier} static {nsprefix}{metricMethod.MetricTypeName} Create{metricMethod.MetricTypeName}({meterParam.Type} {meterParam.Name})");
147
OutLn
($"return {GetMetricDictionaryName(metricMethod)}.GetOrAdd({meterParam.Name}, static _meter =>");
148
OutLn
(" {");
149
OutLn
($" var instrument = _meter.{createMethodName}(@\"{metricMethod.MetricName}\");");
150
OutLn
($" return new {nsprefix}{metricMethod.MetricTypeName}(instrument);");
151
OutLn
(" });");
src\Generators\Shared\EmitterBase.cs (3)
39
OutLn
("{");
46
OutLn
("}");
103
protected void OutGeneratedCodeAttribute() =>
OutLn
($"[{GeneratorUtilities.GeneratedCodeAttribute}]");