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