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() );
Exemplo n.º 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>());
 }
Exemplo n.º 4
0
 static LoggerConfiguration ToMaximumCollectionCount(LoggerDestructuringConfiguration loggerDestructuringConfiguration, int maximumCollectionCount)
 => loggerDestructuringConfiguration.ToMaximumCollectionCount(maximumCollectionCount);
 internal static LoggerConfiguration With(LoggerDestructuringConfiguration loggerDestructuringConfiguration,
                                          IDestructuringPolicy policy)
 {
     return(loggerDestructuringConfiguration.With(policy));
 }
Exemplo n.º 6
0
 public static LoggerConfiguration ProfilerTypes(this LoggerDestructuringConfiguration configuration)
 {
     return(configuration.JsonNetTypes());
 }
Exemplo n.º 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);
Exemplo n.º 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>();
Exemplo n.º 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>();
Exemplo n.º 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>();
Exemplo n.º 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));
Exemplo n.º 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>());
 }
Exemplo n.º 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)));
 }
Exemplo n.º 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>());
 }
Exemplo n.º 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>();
Exemplo n.º 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>());
 }
Exemplo n.º 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>();
Exemplo n.º 19
0
 public static LoggerConfiguration KnitTypes(this LoggerDestructuringConfiguration config)
 => config.ByTransforming <PropertyPath>(p => new { p.Components })
 .Destructure.With(new KnitDestructuringPolicy());
Exemplo n.º 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>();
Exemplo n.º 21
0
 static LoggerConfiguration ToMaximumStringLength(LoggerDestructuringConfiguration loggerDestructuringConfiguration, int maximumStringLength)
 => loggerDestructuringConfiguration.ToMaximumStringLength(maximumStringLength);
Exemplo n.º 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>();
Exemplo n.º 23
0
 static LoggerConfiguration AsScalar(LoggerDestructuringConfiguration loggerDestructuringConfiguration, Type scalarType)
 => loggerDestructuringConfiguration.AsScalar(scalarType);
Exemplo n.º 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 );