Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudLogger has memory leaks #31

Open
DarkNoir opened this issue Dec 18, 2023 · 0 comments
Open

CloudLogger has memory leaks #31

DarkNoir opened this issue Dec 18, 2023 · 0 comments

Comments

@DarkNoir
Copy link
Contributor

DarkNoir commented Dec 18, 2023

  1. Need to dispose of FileStreams:
    using FileStream fs = File.Create(LogFilePath);
    fs.Close();

  2. Should add await Task.Run:

    public async void Log(LogLevel level, string message)
    {
    await Task.Run(() =>
    {
    if (level >= MinLevel)
    {
    var cloudLog = new CloudLog()
    {
    Severity = level.ToString(),
    Message = message,
    Timestamp = DateTime.UtcNow
    };

             Send(LogFilePath, cloudLog, Resolver.MeadowCloudService.SendLog);
         }
     });
    

    }

  3. Fix memory leak in MeadowCloudService.SendLog and SendEvent where HttpResponseMessage and StringContent are not being disposed of

@bryancostanich , I tried to contribute by fixing this and the MeadowCloudLog but wasn't able to branch and create a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant