Skip to content

Commit

Permalink
Log file change (#6)
Browse files Browse the repository at this point in the history
* Update README.md

* Switch to .log

This will automatically open the file in a log reader, or provide syntax highlighting in other programs.

* Changed log file

Opens the log file in the default application
  • Loading branch information
benwa authored Dec 14, 2020
1 parent f8e3692 commit b2b961d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions BgAssist/BigAssistMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ private void btnViewLog_Click(object sender, EventArgs e)

try
{
string logPath = Environment.GetEnvironmentVariable("LocalAppData") + "\\BgAssist\\BgAssist-Log.txt";
Process.Start("notepad.exe",logPath);
string logPath = Environment.GetEnvironmentVariable("LocalAppData") + "\\BgAssist\\BgAssist.log";
Process.Start(logPath);
} catch (Exception ex)
{
logger.Error(ex, "Error opening log file! ");
Expand Down
2 changes: 1 addition & 1 deletion BgAssist/NLog.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<targets>
<target name="file" xsi:type="File"
layout="${longdate} ${level:uppercase=true} | ${message} ${exception:format=ToString}"
fileName="${specialfolder:folder=LocalApplicationData:cached=true}/BgAssist/BgAssist-Log.txt"
fileName="${specialfolder:folder=LocalApplicationData:cached=true}/BgAssist/BgAssist.log"
keepFileOpen="true"
encoding="utf-8" />
</targets>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Identifiable system, platform, client, and user information redacted from BgInfo
1. Set default BgInfo configuration file path. If there are multiple .bgi configuration files in the same directory, users will be able to choose a customized default. **Important:** DO NOT put spaces in .bgi configuration file names.
1. Set BgInfo switches as desired; [reference](https://docs.microsoft.com/en-us/sysinternals/downloads/bginfo).
1. Save BgAssist configuration.
1. Create BgAssist.exe shortcut in *"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"* or use other method to run executable at user login
1. To persist user selected background configuration, capture the following registry key with the appropriate profile roaming technology: HKEY_CURRENT_USER\Software\BgAssist\Config
1. Create BgAssist.exe shortcut in `%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp` or use other method to run executable at user login
1. To persist user selected background configuration, capture the following registry key with the appropriate profile roaming technology: `HKEY_CURRENT_USER\Software\BgAssist\Config`

## Using BgAssist
Once BgAssist is triggered to run, the application will read the configuration (BgAssist-Config.exe.config) and fire BgInfo64. If no user selected configuration is found, BgAssist will use the default configuration defined by the administrator. Otherwise, the user selected configuration will be used.
Expand All @@ -44,7 +44,7 @@ Double clicking the System Tray icon will launch the Desktop Background window w

![BgAssist System Tray](https://github.com/blazcode/BgAssist/blob/master/Screenshots/BgAssist.png)

BgAssist-log.txt is stored at: "C:\Users\%USERNAME%\AppData\Local\BgAssist\BgAssist-Log.txt"
BgAssist.log is stored at `%LocalAppData%\BgAssist\BgAssist.log`

## Best practices
To achieve optimal user experience, consider the following best practices:
Expand Down

0 comments on commit b2b961d

Please sign in to comment.