fix: adjust sample logging to browser debugger

This commit is contained in:
Jerome Laban 2021-08-06 08:21:54 -04:00
Родитель 09f926e6bc
Коммит 44e24deeae
10 изменённых файлов: 23 добавлений и 6 удалений

Просмотреть файл

@ -4,6 +4,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace EFCoreSample
{
@ -57,13 +58,29 @@ namespace EFCoreSample
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
// Uncomment those to enable logging
// optionsBuilder.UseLoggerFactory(LogExtensionPoint.AmbientLoggerFactory);
// optionsBuilder.EnableSensitiveDataLogging(true);
// Uncomment to see EF Core logs in the browser debugger
// EnableLogging(optionsBuilder);
// When building in app, use Windows.Storage.ApplicationData.Current.LocalFolder.Path
// instead of /local to get browser persistence.
optionsBuilder.UseSqlite($"data source=/local/local.db");
}
private void EnableLogging(DbContextOptionsBuilder optionsBuilder)
{
var factory = LoggerFactory.Create(builder =>
{
// The Console logger cannot yet be used until .NET WebAssembly supports threading
builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider());
// Exclude logs below this level
builder.SetMinimumLevel(LogLevel.Information);
});
// Uncomment those to enable logging
optionsBuilder.UseLoggerFactory(factory);
optionsBuilder.EnableSensitiveDataLogging(true);
}
}
}

Просмотреть файл

@ -2,6 +2,8 @@
<assembly fullname="EFCoreSample.Wasm" />
<assembly fullname="Uno.UI" />
<assembly fullname="System.Private.CoreLib" />
<assembly fullname="MonacoEditorComponent" />
<assembly fullname="SQLitePCLRaw.core">
<!--
@ -15,7 +17,7 @@
<!-- This is required by JSon.NET and any expression.Compile caller -->
<type fullname="System.Linq.Expressions*" />
</assembly>
<!-- EFCore support -->
<assembly fullname="Microsoft.EntityFrameworkCore" />
<assembly fullname="System.Data" /> <!-- Needed by https://github.com/aspnet/EntityFrameworkCore/blob/2e1115f0f7ba318e1696841fe49993499cb9d8ae/src/EFCore.Relational/Storage/TypedRelationalValueBufferFactoryFactory.cs#L43 -->

Просмотреть файл

@ -18,8 +18,6 @@ namespace EFCoreSample.Wasm
#endif
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
//SQLitePCL.Batteries.Init();
Windows.UI.Xaml.Application.Start(_ => _app = new App());
}
/// <summary>

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичные данные
src/samples/EFCoreSample/EFCoreSample.Wasm/dotnet-sdk/Uno.Core.dll Normal file

Двоичный файл не отображается.

Двоичный файл не отображается.