Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
995 B

// ==========================================================================
// FileChannel.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using Squidex.Infrastructure.Log.Internal;
namespace Squidex.Infrastructure.Log
{
public sealed class FileChannel : ILogChannel, IExternalSystem
{
private readonly FileLogProcessor processor;
public FileChannel(string path)
{
Guard.NotNullOrEmpty(path, nameof(path));
processor = new FileLogProcessor(path);
}
public void Log(SemanticLogLevel logLevel, string message)
{
processor.EnqueueMessage(new LogMessageEntry { Message = message, Level = logLevel });
}
public void Connect()
{
processor.Connect();
}
}
}