Skip to content

Commit

Permalink
Emergency Log & CleanUp - Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GamerClassN7 committed Jan 16, 2024
1 parent be204a2 commit 672f681
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions HA/Class/Helpers/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Microsoft.VisualBasic.Logging;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
Expand Down Expand Up @@ -40,18 +41,25 @@ public static void setSecreets(string[] strings)
public static void init()
{

path1 = Path.Combine(appDir, (DateTime.Now).ToString("MM_dd_yyyy_log.log")).ToString();
path1 = Path.Combine(appDir, ((DateTime.Now).ToString("MM_dd_yyyy")+ "_log.log")).ToString();
lastInit = DateTime.Now;
if (!File.Exists(path1))
{
File.WriteAllText(path1, getMessage("Initialization", 0 /*info*/), System.Text.Encoding.UTF8);
}

string pathToLogToDelete = Path.Combine(appDir, (DateTime.Now).AddDays(-3).ToString("MM_dd_yyyy_log.log")).ToString();
string pathToLogToDelete = Path.Combine(appDir, ((DateTime.Now).AddDays(-3).ToString("MM_dd_yyyy") + "_log.log")).ToString();
if (File.Exists(pathToLogToDelete))
{
File.Delete(pathToLogToDelete);
}

string oldPathToLogToDelete = Path.Combine(appDir, "log.log").ToString();
if (File.Exists(oldPathToLogToDelete))
{
File.Delete(oldPathToLogToDelete);
}

initialized = true;
}

Expand Down
4 changes: 2 additions & 2 deletions HA/HA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<UseWindowsForms>true</UseWindowsForms>
<PackageIcon>ha_logo.ico</PackageIcon>
<ApplicationIcon>ha_logo.ico</ApplicationIcon>
<AssemblyVersion>0.0.12.1</AssemblyVersion>
<FileVersion>0.0.12.1</FileVersion>
<AssemblyVersion>0.0.12.2</AssemblyVersion>
<FileVersion>0.0.12.2</FileVersion>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\ha_loading.gif" />
Expand Down
2 changes: 1 addition & 1 deletion HA/meta.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.0.12.1</version>
<version>0.0.12.2</version>
<url>https://github.com/GamerClassN7/HA_Desktop_Companion/releases/latest/download/HA_Self_Contained.zip</url>
<changelog>https://github.com/GamerClassN7/HA_Desktop_Companion/releases/latest</changelog>
<mandatory>false</mandatory>
Expand Down

0 comments on commit 672f681

Please sign in to comment.