public ErrorLogViewModel(ShinySqliteConnection conn, ISerializer serializer, IDialogs dialogs) : base(dialogs) { this.conn = conn; this.serializer = serializer; Log .WhenExceptionLogged() .Select(x => new CommandItem { Text = DateTime.Now.ToString(), Detail = x.Exception.ToString(), PrimaryCommand = ReactiveCommand.CreateFromTask(async() => { var s = $"{x.Exception}{Environment.NewLine}"; foreach (var p in x.Parameters) { s += $"{Environment.NewLine}{p.Key}: {p.Value}"; } await this.Dialogs.Alert(s); }) }) .SubOnMainThread(this.InsertItem) .DisposeWith(this.DestroyWith); }
public EventsViewModel(ShinySqliteConnection conn, ISerializer serializer, IDialogs dialogs, INavigationService navigator) : base(dialogs) { this.conn = conn; this.serializer = serializer; this.navigator = navigator; }
public EventLogViewModel( IUserDialogs dialogs, ISerializer serializer, ShinySqliteConnection connection) : base(dialogs) { this.connection = connection; this.serializer = serializer; Log .WhenEventLogged() // .ObserveOn(RxApp.MainThreadScheduler) .Select(x => new LogStore { Description = x.EventName, Detail = x.Description, Parameters = this.serializer.Serialize(x.Parameters), TimestampUtc = DateTime.UtcNow }).SubOnMainThread(Add) .DisposeWith(DestroyWith); }
public ErrorLogViewModel( IUserDialogs dialogs, ISerializer serializer, ShinySqliteConnection connection) : base(dialogs) { this.conn = connection; this.serializer = serializer; Log .WhenExceptionLogged() .Select(x => new LogStore { Description = x.Exception.ToString(), Detail = string.Empty, Parameters = this.serializer.Serialize(x.Parameters), IsError = true, TimestampUtc = DateTime.UtcNow }) .SubOnMainThread(this.Add) .DisposeWith(this.DestroyWith); }
public SqliteLogger(LogLevel logLevel, ShinySqliteConnection conn) { this.configLogLevel = logLevel; this.conn = conn; }