mirror of https://github.com/Squidex/squidex.git
17 changed files with 191 additions and 24 deletions
@ -0,0 +1,34 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using System; |
|||
using System.IO; |
|||
using System.Threading.Tasks; |
|||
using Squidex.Infrastructure; |
|||
using Squidex.Infrastructure.Log; |
|||
|
|||
namespace Squidex.Domain.Apps.Entities.Apps |
|||
{ |
|||
public sealed class DefaultAppLogStore : IAppLogStore |
|||
{ |
|||
private readonly ILogStore logStore; |
|||
|
|||
public DefaultAppLogStore(ILogStore logStore) |
|||
{ |
|||
Guard.NotNull(logStore, nameof(logStore)); |
|||
|
|||
this.logStore = logStore; |
|||
} |
|||
|
|||
public Task ReadLogAsync(IAppEntity app, DateTime from, DateTime to, Stream stream) |
|||
{ |
|||
Guard.NotNull(app, nameof(app)); |
|||
|
|||
return logStore.ReadLogAsync(app.Id.ToString(), from, to, stream); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using System; |
|||
using System.IO; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Squidex.Domain.Apps.Entities.Apps |
|||
{ |
|||
public interface IAppLogStore |
|||
{ |
|||
Task ReadLogAsync(IAppEntity app, DateTime from, DateTime to, Stream stream); |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using System; |
|||
using System.IO; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Squidex.Infrastructure.Log |
|||
{ |
|||
public sealed class NoopLogStore : ILogStore |
|||
{ |
|||
private static readonly byte[] NoopText = Encoding.UTF8.GetBytes("Not Supported"); |
|||
|
|||
public Task ReadLogAsync(string key, DateTime from, DateTime to, Stream stream) |
|||
{ |
|||
return stream.WriteAsync(NoopText, 0, NoopText.Length); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue