Merge pull request #26 from unoplatform/dev/jela/sample-logging
fix: adjust sample logging to browser debugger
This commit is contained in:
Коммит
a4005526c6
|
@ -1,6 +1,10 @@
|
|||
assembly-versioning-scheme: MajorMinorPatch
|
||||
mode: Mainline
|
||||
next-version: 3.0.0
|
||||
|
||||
# Don't use next-version with Mainline (changed since 5.3), otherwise the stable
|
||||
# branch will not count on commits, only on tags.
|
||||
# See https://github.com/GitTools/GitVersion/issues/2461#issuecomment-733658087
|
||||
# next-version: 3.0
|
||||
|
||||
branches:
|
||||
master:
|
||||
|
@ -35,7 +39,7 @@ branches:
|
|||
mode: ContinuousDeployment
|
||||
regex: ^dev/.*?/(.*?)
|
||||
tag: dev.{BranchName}
|
||||
source-branches: ['master', 'release', 'projects', 'feature']
|
||||
source-branches: ['master', 'stable', 'projects', 'feature']
|
||||
increment: none
|
||||
|
||||
projects:
|
||||
|
@ -50,5 +54,9 @@ branches:
|
|||
source-branches: ['master']
|
||||
increment: none
|
||||
|
||||
release:
|
||||
# disable default release branch
|
||||
regex: ignore
|
||||
|
||||
ignore:
|
||||
sha: []
|
||||
sha: []
|
|
@ -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/Microsoft.Extensions.Logging.Configuration.dll
Normal file
Двоичные данные
src/samples/EFCoreSample/EFCoreSample.Wasm/dotnet-sdk/Microsoft.Extensions.Logging.Configuration.dll
Normal file
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичные данные
src/samples/EFCoreSample/EFCoreSample.Wasm/dotnet-sdk/Uno.Extensions.Logging.WebAssembly.Console.dll
Normal file
Двоичные данные
src/samples/EFCoreSample/EFCoreSample.Wasm/dotnet-sdk/Uno.Extensions.Logging.WebAssembly.Console.dll
Normal file
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче