Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
sungam3r committed Mar 24, 2024
1 parent 8524a58 commit aec3201
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,11 @@ private CacheEntry CreateCacheEntry(Type type)
if (attr != null)
return attr;

if (_options.RespectLogPropertyIgnoreAttribute)
{
// Do not check attribute explicitly to not take dependency from Microsoft.Extensions.Telemetry.Abstractions package.
// https://github.com/serilog/serilog/issues/1984
if (propertyInfo.GetCustomAttributes().Any(a => a.GetType().FullName == "Microsoft.Extensions.Logging.LogPropertyIgnoreAttribute"))
return NotLoggedAttribute.Instance;
}

return null;
// Do not check attribute explicitly to not take dependency from Microsoft.Extensions.Telemetry.Abstractions package.
// https://github.com/serilog/serilog/issues/1984
return _options.RespectLogPropertyIgnoreAttribute && propertyInfo.GetCustomAttributes().Any(a => a.GetType().FullName == "Microsoft.Extensions.Logging.LogPropertyIgnoreAttribute")

Check warning

Code scanning / CodeQL

Erroneous class compare Warning

Erroneous class compare.
? NotLoggedAttribute.Instance
: null;
}

var classDestructurer = type.GetCustomAttributes().OfType<ITypeDestructuringAttribute>().FirstOrDefault();
Expand Down

1 comment on commit aec3201

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: aec3201 Previous: 4302b25 Ratio
Benchmarks.AttributedBenchmarks.LogAsScalar 265.6944563865662 ns (± 1.7673664873754076) 227.72338834175696 ns (± 1.6033094432396349) 1.17

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.