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>() => AppBuilder.Configure<App>()
.UsePlatformDetect() .UsePlatformDetect()
.UseReactiveUI() .UseReactiveUI()
.LogToDebug(); .LogToTrace();
} }
} }

2
samples/ControlCatalog.Desktop/Program.cs

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

2
samples/ControlCatalog.NetCore/Program.cs

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

2
samples/RenderDemo/App.xaml.cs

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

2
samples/Sandbox/Program.cs

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

2
samples/VirtualizationDemo/Program.cs

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

3
src/Avalonia.Base/ApiCompatBaseline.txt

@ -1,3 +1,4 @@
Compat issues with assembly Avalonia.Base: 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. 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 namespace Avalonia.Logging
{ {
public class DebugLogSink : ILogSink public class TraceLogSink : ILogSink
{ {
private readonly LogEventLevel _level; private readonly LogEventLevel _level;
private readonly IList<string> _areas; private readonly IList<string> _areas;
public DebugLogSink( public TraceLogSink(
LogEventLevel minimumLevel, LogEventLevel minimumLevel,
IList<string> areas = null) IList<string> areas = null)
{ {
@ -28,7 +28,7 @@ namespace Avalonia.Logging
{ {
if (IsEnabled(level, area)) 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)) 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)) 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)) 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)) 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; using Avalonia.Logging;
namespace Avalonia namespace Avalonia
{ {
public static class LoggingExtensions 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> /// <summary>
/// Logs Avalonia events to the <see cref="System.Diagnostics.Debug"/> sink. /// Logs Avalonia events to the <see cref="System.Diagnostics.Trace"/> sink.
/// </summary> /// </summary>
/// <typeparam name="T">The application class type.</typeparam> /// <typeparam name="T">The application class type.</typeparam>
/// <param name="builder">The app builder instance.</param> /// <param name="builder">The app builder instance.</param>
/// <param name="level">The minimum level to log.</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> /// <param name="areas">The areas to log. Valid values are listed in <see cref="LogArea"/>.</param>
/// <returns>The app builder instance.</returns> /// <returns>The app builder instance.</returns>
public static T LogToDebug<T>( public static T LogToTrace<T>(
this T builder, this T builder,
LogEventLevel level = LogEventLevel.Warning, LogEventLevel level = LogEventLevel.Warning,
params string[] areas) params string[] areas)
where T : AppBuilderBase<T>, new() where T : AppBuilderBase<T>, new()
{ {
Logger.Sink = new DebugLogSink(level, areas); Logger.Sink = new TraceLogSink(level, areas);
return builder; return builder;
} }
} }

Loading…
Cancel
Save