Browse Source

Merge branch 'master' into do-not-sign-rxui-attempt-2

pull/4908/head
Jumar Macato 5 years ago
committed by GitHub
parent
commit
f92b5763df
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      samples/BindingDemo/App.xaml.cs
  2. 2
      samples/ControlCatalog.Desktop/Program.cs
  3. 2
      samples/ControlCatalog.NetCore/Program.cs
  4. 2
      samples/RenderDemo/App.xaml.cs
  5. 2
      samples/Sandbox/Program.cs
  6. 2
      samples/VirtualizationDemo/Program.cs
  7. 3
      src/Avalonia.Base/ApiCompatBaseline.txt
  8. 14
      src/Avalonia.Base/Logging/TraceLogSink.cs
  9. 19
      src/Avalonia.Controls/LoggingExtensions.cs

2
samples/BindingDemo/App.xaml.cs

@ -26,6 +26,6 @@ namespace BindingDemo
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseReactiveUI()
.LogToDebug();
.LogToTrace();
}
}

2
samples/ControlCatalog.Desktop/Program.cs

@ -18,7 +18,7 @@ namespace ControlCatalog
/// </summary>
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.LogToDebug()
.LogToTrace()
.UsePlatformDetect()
.UseReactiveUI();

2
samples/ControlCatalog.NetCore/Program.cs

@ -121,7 +121,7 @@ namespace ControlCatalog.NetCore
.UseSkia()
.UseReactiveUI()
.UseManagedSystemDialogs()
.LogToDebug();
.LogToTrace();
static void SilenceConsole()
{

2
samples/RenderDemo/App.xaml.cs

@ -33,6 +33,6 @@ namespace RenderDemo
})
.UsePlatformDetect()
.UseReactiveUI()
.LogToDebug();
.LogToTrace();
}
}

2
samples/Sandbox/Program.cs

@ -10,7 +10,7 @@ namespace Sandbox
AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseReactiveUI()
.LogToDebug()
.LogToTrace()
.StartWithClassicDesktopLifetime(args);
}
}

2
samples/VirtualizationDemo/Program.cs

@ -9,7 +9,7 @@ namespace VirtualizationDemo
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseReactiveUI()
.LogToDebug();
.LogToTrace();
public static int Main(string[] args)
=> BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);

3
src/Avalonia.Base/ApiCompatBaseline.txt

@ -1,3 +1,4 @@
Compat issues with assembly Avalonia.Base:
CannotAddAbstractMembers : Member 'protected System.IObservable<Avalonia.AvaloniaPropertyChangedEventArgs> Avalonia.AvaloniaProperty.GetChanged()' is abstract in the implementation but is missing in the contract.
Total Issues: 1
TypesMustExist : Type 'Avalonia.Logging.DebugLogSink' does not exist in the implementation but it does exist in the contract.
Total Issues: 2

14
src/Avalonia.Base/Logging/DebugLogSink.cs → src/Avalonia.Base/Logging/TraceLogSink.cs

@ -6,12 +6,12 @@ using Avalonia.Utilities;
namespace Avalonia.Logging
{
public class DebugLogSink : ILogSink
public class TraceLogSink : ILogSink
{
private readonly LogEventLevel _level;
private readonly IList<string> _areas;
public DebugLogSink(
public TraceLogSink(
LogEventLevel minimumLevel,
IList<string> areas = null)
{
@ -28,7 +28,7 @@ namespace Avalonia.Logging
{
if (IsEnabled(level, area))
{
Debug.WriteLine(Format<object, object, object>(area, messageTemplate, source));
Trace.WriteLine(Format<object, object, object>(area, messageTemplate, source));
}
}
@ -36,7 +36,7 @@ namespace Avalonia.Logging
{
if (IsEnabled(level, area))
{
Debug.WriteLine(Format<T0, object, object>(area, messageTemplate, source, propertyValue0));
Trace.WriteLine(Format<T0, object, object>(area, messageTemplate, source, propertyValue0));
}
}
@ -44,7 +44,7 @@ namespace Avalonia.Logging
{
if (IsEnabled(level, area))
{
Debug.WriteLine(Format<T0, T1, object>(area, messageTemplate, source, propertyValue0, propertyValue1));
Trace.WriteLine(Format<T0, T1, object>(area, messageTemplate, source, propertyValue0, propertyValue1));
}
}
@ -52,7 +52,7 @@ namespace Avalonia.Logging
{
if (IsEnabled(level, area))
{
Debug.WriteLine(Format(area, messageTemplate, source, propertyValue0, propertyValue1, propertyValue2));
Trace.WriteLine(Format(area, messageTemplate, source, propertyValue0, propertyValue1, propertyValue2));
}
}
@ -60,7 +60,7 @@ namespace Avalonia.Logging
{
if (IsEnabled(level, area))
{
Debug.WriteLine(Format(area, messageTemplate, source, propertyValues));
Trace.WriteLine(Format(area, messageTemplate, source, propertyValues));
}
}

19
src/Avalonia.Controls/LoggingExtensions.cs

@ -1,25 +1,36 @@
using Avalonia.Controls;
using System;
using Avalonia.Controls;
using Avalonia.Logging;
namespace Avalonia
{
public static class LoggingExtensions
{
[Obsolete("Use LogToTrace")]
public static T LogToDebug<T>(
this T builder,
LogEventLevel level = LogEventLevel.Warning,
params string[] areas)
where T : AppBuilderBase<T>, new()
{
return LogToTrace(builder, level, areas);
}
/// <summary>
/// Logs Avalonia events to the <see cref="System.Diagnostics.Debug"/> sink.
/// Logs Avalonia events to the <see cref="System.Diagnostics.Trace"/> sink.
/// </summary>
/// <typeparam name="T">The application class type.</typeparam>
/// <param name="builder">The app builder instance.</param>
/// <param name="level">The minimum level to log.</param>
/// <param name="areas">The areas to log. Valid values are listed in <see cref="LogArea"/>.</param>
/// <returns>The app builder instance.</returns>
public static T LogToDebug<T>(
public static T LogToTrace<T>(
this T builder,
LogEventLevel level = LogEventLevel.Warning,
params string[] areas)
where T : AppBuilderBase<T>, new()
{
Logger.Sink = new DebugLogSink(level, areas);
Logger.Sink = new TraceLogSink(level, areas);
return builder;
}
}

Loading…
Cancel
Save