public static LoggerConfiguration WithDummyHardCodedString(
     this LoggerDestructuringConfiguration loggerDestructuringConfiguration,
     string hardCodedString)
 {
     return(loggerDestructuringConfiguration.With(new DummyHardCodedStringDestructuringPolicy(hardCodedString)));
 }
		protected override void Configure( LoggerDestructuringConfiguration configuration ) => configuration.With( Policies.Fixed() );
Пример #3
0
 /// <summary>
 ///     Enable destructuring of JSON.NET dynamic objects.
 /// </summary>
 /// <param name="configuration">The logger configuration to apply configuration to.</param>
 /// <returns>An object allowing configuration to continue.</returns>
 public static LoggerConfiguration NewtonsoftJsonTypes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.With <NewtonsoftJsonDestructuringPolicy>());
 }
Пример #4
0
 static LoggerConfiguration ToMaximumCollectionCount(LoggerDestructuringConfiguration loggerDestructuringConfiguration, int maximumCollectionCount)
 => loggerDestructuringConfiguration.ToMaximumCollectionCount(maximumCollectionCount);
 internal static LoggerConfiguration With(LoggerDestructuringConfiguration loggerDestructuringConfiguration,
                                          IDestructuringPolicy policy)
 {
     return(loggerDestructuringConfiguration.With(policy));
 }
Пример #6
0
 public static LoggerConfiguration ProfilerTypes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.JsonNetTypes());
 }
Пример #7
0
 // .Destructure...
 // ============
 // TODO: add overload for array argument (IDestructuringPolicy[])
 // expose `With(params IDestructuringPolicy[] destructuringPolicies)` as if it was `With(IDestructuringPolicy policy)`
 static LoggerConfiguration With(LoggerDestructuringConfiguration loggerDestructuringConfiguration, IDestructuringPolicy policy)
 => loggerDestructuringConfiguration.With(policy);
Пример #8
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.Duration
 /// </summary>
 /// <remarks>Deserialisation: Use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithDuration(this LoggerDestructuringConfiguration ldc) => ldc.With <DurationDestructuringPolicy>();
Пример #9
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.Period
 /// </summary>
 /// <remarks>Deserialisation: PeriodPattern.Roundtrip.Parse(str) or use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithPeriod(this LoggerDestructuringConfiguration ldc) => ldc.With <PeriodDestructuringPolicy>();
Пример #10
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.DateTimeZone
 /// </summary>
 /// <remarks>Deserialisation: Use IDateTimeZoneProvider or NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithDateTimeZone(this LoggerDestructuringConfiguration ldc) => ldc.With <DateTimeZoneDestructuringPolicy>();
Пример #11
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.ZonedDateTime
 /// </summary>
 /// <remarks>Deserialisation: Use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithZonedDateTime(this LoggerDestructuringConfiguration ldc, IDateTimeZoneProvider provider) => ldc.With(new ZonedDateTimeDestructuringPolicy(provider));
Пример #12
0
 /// <summary>
 /// Enable destructuring of JSON.NET dynamic objects.
 /// </summary>
 /// <param name="configuration">The logger configuration to apply configuration to.</param>
 /// <returns>An object allowing configuration to continue.</returns>
 public static LoggerConfiguration JsonNetTypes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.With <JsonNetDestructuringPolicy>());
 }
Пример #13
0
 /// <summary>
 ///     Enable destructuring of JSON.NET dynamic objects.
 /// </summary>
 /// <param name="configuration">The logger configuration to apply configuration to.</param>
 /// <returns>An object allowing configuration to continue.</returns>
 public static LoggerConfiguration NetTopologySuiteTypes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.With <NetTopologySuiteDestructuringPolicy>());
 }
 /// <summary>
 /// Destructure.ByIgnoringProperties takes one or more expressions that access a property, e.g. obj => obj.Property, and uses the property names to determine which
 /// properties are ignored when an object of type TDestruture is destructured by serilog.
 /// </summary>
 /// <param name="configuration">The logger configuration to apply configuration to.</param>
 /// <param name="ignoredProperty">The function expressions that expose the properties to ignore.</param>
 /// <returns>An object allowing configuration to continue.</returns>
 public static LoggerConfiguration ByIgnoringProperties <TDestruture>(this LoggerDestructuringConfiguration configuration, params Expression <Func <TDestruture, object> >[] ignoredProperty)
 {
     return(configuration.With(new DestructureByIgnoringPolicy <TDestruture>(ignoredProperty)));
 }
Пример #15
0
 /// <summary>
 ///     Enable destructuring of JSON.NET dynamic objects.
 /// </summary>
 /// <param name="configuration">The logger configuration to apply configuration to.</param>
 /// <returns>An object allowing configuration to continue.</returns>
 public static LoggerConfiguration SystemTextJsonTypes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.With <SystemTextJsonDestructuringPolicy>());
 }
Пример #16
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.Instant
 /// </summary>
 /// <remarks>Deserialisation: InstantPattern.General.Parse(str) or use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithInstant(this LoggerDestructuringConfiguration ldc) => ldc.With <InstantDestructuringPolicy>();
Пример #17
0
 /// <summary>
 /// </summary>
 /// <param name="configuration">The logger configuration to apply configuration to.</param>
 /// <returns>An object allowing configuration to continue.</returns>
 public static LoggerConfiguration UsingAttributes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.With <AttributedDestructuringPolicy>());
 }
Пример #18
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.Offset
 /// </summary>
 /// <remarks>Deserialisation: OffsetPattern.GeneralInvariant.Parse(str) or use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithOffset(this LoggerDestructuringConfiguration ldc) => ldc.AsScalar <Offset>();
Пример #19
0
 public static LoggerConfiguration KnitTypes(this LoggerDestructuringConfiguration config)
 => config.ByTransforming <PropertyPath>(p => new { p.Components })
 .Destructure.With(new KnitDestructuringPolicy());
Пример #20
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.CalendarSystem
 /// </summary>
 /// <remarks>Deserialisation: CalendarSystem.ForId(str)</remarks>
 public static LoggerConfiguration WithCalendarSystem(this LoggerDestructuringConfiguration ldc) => ldc.AsScalar <CalendarSystem>();
Пример #21
0
 static LoggerConfiguration ToMaximumStringLength(LoggerDestructuringConfiguration loggerDestructuringConfiguration, int maximumStringLength)
 => loggerDestructuringConfiguration.ToMaximumStringLength(maximumStringLength);
Пример #22
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.LocalTime
 /// </summary>
 /// <remarks>Deserialisation: LocalTimePattern.ExtendedIso.Parse(str) or use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithLocalTime(this LoggerDestructuringConfiguration ldc) => ldc.With <LocalTimeDestructuringPolicy>();
Пример #23
0
 static LoggerConfiguration AsScalar(LoggerDestructuringConfiguration loggerDestructuringConfiguration, Type scalarType)
 => loggerDestructuringConfiguration.AsScalar(scalarType);
Пример #24
0
 /// <summary>
 /// Adds support for logging instances of NodaTime.OffsetDate
 /// </summary>
 /// <remarks>Deserialisation: OffsetDatePattern.GeneralIso.Parse(str) or use NodaTime.Serialization.JsonNet</remarks>
 public static LoggerConfiguration WithOffsetDate(this LoggerDestructuringConfiguration ldc) => ldc.With <OffsetDateDestructuringPolicy>();
		protected override void Configure( LoggerDestructuringConfiguration configuration ) => configuration.ToMaximumDepth( MaximumDepth );
		protected override void Configure( LoggerDestructuringConfiguration configuration ) => configuration.AsScalar( ScalarType );