55 references to OutLn
Microsoft.Gen.Logging (55)
Emission\Emitter.cs (4)
37
OutLn
($"namespace {lt.Namespace}");
54
OutLn
(parentTypes[i]);
58
OutLn
($"partial {lt.Keyword} {lt.Name}");
119
OutLn
($"private static readonly Microsoft.Extensions.Compliance.Classification.DataClassification {fieldName} = new {classificationAttr}().Classification;");
Emission\Emitter.Method.cs (48)
36
OutLn
($"/// <summary>");
40
OutLn
($"/// Logs \"{EscapeMessageStringForXmlDocumentation(lm.Message)}\"{lvl}.");
44
OutLn
($"/// Emits a structured log entry{lvl}.");
47
OutLn
($"/// </summary>");
61
OutLn
($"if ({logger} == null)");
63
OutLn
("return;");
70
OutLn
($"if (!{logger}.IsEnabled({level}))");
72
OutLn
("return;");
79
OutLn
($"var {stateName} = {LoggerMessageHelperType}.ThreadLocalState;");
83
OutLn
($"{logger}.Log(");
86
OutLn
($"{level},");
90
OutLn
($"new({lm.EventId}, {eventName}),");
94
OutLn
($"new({GetNonRandomizedHashCode(eventName)}, {eventName}),");
97
OutLn
($"{stateName},");
98
OutLn
($"{exceptionArg},");
102
OutLn
($"[{GeneratorUtilities.GeneratedCodeAttribute}] static string ({lambdaStateName}, {exceptionLambdaName}) =>");
119
OutLn
($@"#if NET");
120
OutLn
($@"return string.Create(global::System.Globalization.CultureInfo.InvariantCulture, ${s});");
121
OutLn
($@"#else");
122
OutLn
($@"return global::System.FormattableString.Invariant(${s});");
123
OutLn
($@"#endif");
127
OutLn
($@"return string.Empty;");
131
OutLn
($@"return {EscapeMessageString(lm.Message)};");
138
OutLn
($"{stateName}.Clear();");
319
OutLn
($"_ = {stateName}.ReserveTagSpace({numReservedUnclassifiedTags});");
341
OutLn
($"{stateName}.TagArray[{--count}] = new({key}, {value});");
364
OutLn
($"{stateName}.TagArray[{--count}] = new(\"{propName}\", {value});");
372
OutLn
($"{stateName}.TagArray[{--count}] = new(\"{{OriginalFormat}}\", {EscapeMessageString(lm.Message)});");
379
OutLn
($"_ = {stateName}.ReserveClassifiedTagSpace({numReservedClassifiedTags});");
392
OutLn
($"{stateName}.ClassifiedTagArray[{--count}] = new({key}, {value}, {classification});");
413
OutLn
($"{stateName}.ClassifiedTagArray[{--count}] = new(\"{propName}\", {value}, {classification});");
440
OutLn
($"var {tmpVarName} = {value};");
441
OutLn
($"if ({tmpVarName} != null)");
443
OutLn
($"{stateName}.AddClassifiedTag(\"{propName}\", {tmpVarName}, {classification});");
450
OutLn
($"{stateName}.AddClassifiedTag(\"{propName}\", {value}, {classification});");
471
OutLn
($"if ({accessExpression} != null)");
473
OutLn
($"{stateName}.AddTag(\"{propName}\", {value});");
481
OutLn
($"var {tmpVarName} = {value};");
482
OutLn
($"if ({tmpVarName} != null)");
484
OutLn
($"{stateName}.AddTag(\"{propName}\", {tmpVarName});");
492
OutLn
($"{stateName}.AddTag(\"{propName}\", {value});");
502
OutLn
($"{stateName}.TagNamePrefix = string.Empty;");
506
OutLn
($"{stateName}.TagNamePrefix = nameof({p.ParameterNameWithAtIfNeeded});");
509
OutLn
($"{p.TagProvider!.ContainingType}.{p.TagProvider.MethodName}({stateName}, {p.ParameterNameWithAtIfNeeded});");
532
OutLn
($"var {atSign}{p.ParameterName} = {lambdaStateName}.TagArray[{index}].Value ?? {Null};");
536
OutLn
($"var {atSign}{p.ParameterName} = {lambdaStateName}.TagArray[{index}].Value;");
561
OutLn
($"var {atSign}{p.ParameterName} = {lambdaStateName}.RedactedTagArray[{index}].Value ?? {Null};");
565
OutLn
($"var {atSign}{p.ParameterName} = {lambdaStateName}.RedactedTagArray[{index}].Value;");
src\Generators\Shared\EmitterBase.cs (3)
39
OutLn
("{");
46
OutLn
("}");
103
protected void OutGeneratedCodeAttribute() =>
OutLn
($"[{GeneratorUtilities.GeneratedCodeAttribute}]");