Skip to content

Commit

Permalink
Merge pull request #46 from WildernessLabs/cloud_logger_cleanup
Browse files Browse the repository at this point in the history
remove unneeded props
  • Loading branch information
ctacke authored Apr 17, 2024
2 parents 3fc0666 + 84bf100 commit 687f185
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions Source/Meadow.Logging.LogProviders/Driver/CloudLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace Meadow.Logging;

/// <summary>
/// Meadow.Cloud logging
/// </summary>
public class CloudLogger : ILogProvider
{
/// <summary>
Expand All @@ -23,37 +26,13 @@ public CloudLogger(LogLevel level = LogLevel.Information)
}

MinLevel = level;

LogFilePath = Path.Combine(Resolver.Device.PlatformOS.FileSystem.DocumentsDirectory, "cloud.log");
if (!File.Exists(LogFilePath))
{
using FileStream fs = File.Create(LogFilePath);
fs.Close();
}

EventFilePath = Path.Combine(Resolver.Device.PlatformOS.FileSystem.DocumentsDirectory, "events.log");
if (!File.Exists(EventFilePath))
{
using FileStream fs = File.Create(EventFilePath);
fs.Close();
}
}

/// <summary>
/// Path to the log file
/// </summary>
public string LogFilePath { get; protected set; }
/// <summary>
/// Path to the event file
/// </summary>
public string EventFilePath { get; protected set; }

/// <summary>
/// Current minimum level for the CloudLogger
/// </summary>
public LogLevel MinLevel { get; protected set; }

private static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1);

/// <inheritdoc/>
public void Log(LogLevel level, string message, string? _)
{
Expand Down

0 comments on commit 687f185

Please sign in to comment.