40 references to OutLn
Microsoft.Gen.Metrics (40)
Emitter.cs (26)
54
OutLn
($"namespace {nspace}");
116
OutLn
(parentTypes[i]);
121
OutLn
($"{metricType.Modifiers} {metricType.Keyword} {metricType.Name} {metricType.Constraints}");
199
OutLn
($"{accessModifier} sealed class {metricMethod.MetricTypeName}");
200
OutLn
($"{{");
201
OutLn
($" private readonly {typeDefinition} _{objectName};");
203
OutLn
($" public {metricMethod.MetricTypeName}({typeDefinition} {objectName})");
204
OutLn
($" {{");
205
OutLn
($" _{objectName} = {objectName};");
206
OutLn
($" }}");
215
OutLn
($" {{");
221
OutLn
($" if (!_{objectName}.Enabled)");
222
OutLn
($" {{");
223
OutLn
($" return;");
224
OutLn
($" }}");
230
OutLn
($" if (o == null)");
231
OutLn
($" {{");
232
OutLn
($" throw new global::System.ArgumentNullException(nameof(o));");
233
OutLn
($" }}");
241
OutLn
("var tagList = new global::System.Diagnostics.TagList");
245
OutLn
("};");
251
OutLn
($" _{objectName}.{recordStatement}(value{(tagListInit ? ", tagList" : string.Empty)});");
252
OutLn
($" }}");
253
OutLn
("}");
309
OutLn
($"new global::System.Collections.Generic.KeyValuePair<string, object?>(\"{tagName}\", {paramName}),");
331
OutLn
($"new global::System.Collections.Generic.KeyValuePair<string, object?>(\"{config.TagName}\", {access}),");
MetricFactoryEmitter.cs (11)
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();");
147
OutLn
($"{accessModifier} static {nsprefix}{metricMethod.MetricTypeName} Create{metricMethod.MetricTypeName}({meterParam.Type} {meterParam.Name})");
149
OutLn
($"return {GetMetricDictionaryName(metricMethod)}.GetOrAdd({meterParam.Name}, static _meter =>");
150
OutLn
(" {");
153
OutLn
($" var instrument = _meter.{createMethodName}(@\"{metricMethod.MetricName}\");");
157
OutLn
($" var instrument = _meter.{createMethodName}(@\"{metricMethod.MetricName}\", @\"{metricMethod.MetricUnit}\");");
160
OutLn
($" return new {nsprefix}{metricMethod.MetricTypeName}(instrument);");
161
OutLn
(" });");
src\Generators\Shared\EmitterBase.cs (3)
39
OutLn
("{");
46
OutLn
("}");
103
protected void OutGeneratedCodeAttribute() =>
OutLn
($"[{GeneratorUtilities.GeneratedCodeAttribute}]");