Skip to content

Commit

Permalink
chore: log version of application (#167)
Browse files Browse the repository at this point in the history
Co-authored-by: Damien Haynes <[email protected]>
  • Loading branch information
damienhaynes and Damien Haynes authored Aug 23, 2024
1 parent e2d022b commit 8b86b37
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.14.0")]
[assembly: AssemblyFileVersion("2.3.14.0")]
[assembly: AssemblyVersion("2.3.15.0")]
[assembly: AssemblyFileVersion("2.3.15.0")]
27 changes: 18 additions & 9 deletions TraktRater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public partial class TraktRater : Form
static bool mImportRunning = false;
static bool mImportCancelled = false;
static string mPinCode = string.Empty;
static string mVersion = string.Empty;
#endregion

#region Constants
Expand All @@ -43,8 +44,7 @@ public partial class TraktRater : Form

#region Constructor
public TraktRater()
{
FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";
{
InitializeComponent();
}
#endregion
Expand All @@ -53,7 +53,12 @@ public TraktRater()
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Text = "TraktRater v" + Assembly.GetEntryAssembly().GetName().Version;

mVersion = "TraktRater v" + Assembly.GetEntryAssembly().GetName().Version;
Text = mVersion;

InitialiseLog();

AppSettings.Load();
ClearProgress();

Expand Down Expand Up @@ -712,8 +717,7 @@ private void StartImport()
if (!CheckAccountDetails() || mImportRunning)
return;

// update file log with new name
FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";
InitialiseLog();

mSites.Clear();

Expand Down Expand Up @@ -806,8 +810,7 @@ private void StartMaintenance(MaintenanceSettings settings)
if (!CheckAccountDetails() || mMaintenanceRunning)
return;

// update file log with new name
FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";
InitialiseLog();

var maintThread = new Thread(o =>
{
Expand Down Expand Up @@ -910,8 +913,7 @@ private void StartExport(ExportItems items)
if (!CheckAccountDetails() || mExportRunning)
return;

// update file log with new name
FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";
InitialiseLog();

var mainThread = new Thread(o =>
{
Expand Down Expand Up @@ -1049,6 +1051,13 @@ private void CancelExport()

#region Private Methods

private void InitialiseLog()
{
// update file log with new name
FileLog.LogFileName = DateTime.Now.ToString("yyyyMMdd_hhmmss") + ".log";
FileLog.Info(mVersion);
}

private bool Login()
{
// exchange pin-code for access token or refresh existing token
Expand Down

0 comments on commit 8b86b37

Please sign in to comment.