41 references to OutLn
Microsoft.Gen.Metrics (41)
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 (12)
65OutLn($"namespace {nspace}"); 70OutLn("internal static partial class GeneratedInstrumentsFactory"); 110OutLn($"private static global::System.Collections.Concurrent.ConcurrentDictionary<{meterParam.Type}, {nsprefix}{metricMethod.MetricTypeName}>"); 111OutLn($" {GetMetricDictionaryName(metricMethod)} = new();"); 148OutLn($"{accessModifier} static {nsprefix}{metricMethod.MetricTypeName} Create{metricMethod.MetricTypeName}({meterParam.Type} {meterParam.Name})"); 150OutLn($"return {GetMetricDictionaryName(metricMethod)}.GetOrAdd({meterParam.Name}, static _meter =>"); 151OutLn(" {"); 155OutLn($" var instrument = _meter.{createMethodName}(@\"{metricMethod.MetricName}\", {unit}, {SymbolDisplay.FormatLiteral(description, quote: true)});"); 159OutLn($" var instrument = _meter.{createMethodName}(@\"{metricMethod.MetricName}\");"); 163OutLn($" var instrument = _meter.{createMethodName}(@\"{metricMethod.MetricName}\", @\"{metricMethod.MetricUnit}\");"); 166OutLn($" return new {nsprefix}{metricMethod.MetricTypeName}(instrument);"); 167OutLn(" });");
src\Generators\Shared\EmitterBase.cs (3)
39OutLn("{"); 46OutLn("}"); 103protected void OutGeneratedCodeAttribute() => OutLn($"[{GeneratorUtilities.GeneratedCodeAttribute}]");