mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Shorten app data path to '%localappdata' in console log messages
This commit is contained in:
@@ -469,12 +469,16 @@ namespace SquirrelCli
|
|||||||
|
|
||||||
private readonly object gate = new object();
|
private readonly object gate = new object();
|
||||||
|
|
||||||
|
private readonly string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||||
|
|
||||||
public void Write(string message, LogLevel logLevel)
|
public void Write(string message, LogLevel logLevel)
|
||||||
{
|
{
|
||||||
if (logLevel < Level) {
|
if (logLevel < Level) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message = message.Replace(localAppData, "%localappdata%", StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
lock (gate) {
|
lock (gate) {
|
||||||
string lvl = logLevel.ToString().Substring(0, 4).ToUpper();
|
string lvl = logLevel.ToString().Substring(0, 4).ToUpper();
|
||||||
if (logLevel == LogLevel.Error || logLevel == LogLevel.Fatal) {
|
if (logLevel == LogLevel.Error || logLevel == LogLevel.Fatal) {
|
||||||
|
|||||||
Reference in New Issue
Block a user