Logging and more Service setup

This commit is contained in:
Cyberboss
2017-10-24 16:07:44 -04:00
parent df663d8eb1
commit 42a98df47b
16 changed files with 235 additions and 134 deletions
+6 -6
View File
@@ -81,7 +81,7 @@ namespace TGServerService
var output = File.ReadAllText(path);
Service.CancelImpersonation();
Service.WriteInfo("Read of " + path, EventID.StaticRead);
WriteInfo("Read of " + path, EventID.StaticRead);
error = null;
unauthorized = false;
return output;
@@ -98,7 +98,7 @@ namespace TGServerService
{
error = e.ToString();
Service.CancelImpersonation();
Service.WriteWarning(String.Format("Read of {0} failed! Error: {1}", path, e.ToString()), EventID.StaticRead);
WriteWarning(String.Format("Read of {0} failed! Error: {1}", path, e.ToString()), EventID.StaticRead);
unauthorized = false;
return null;
}
@@ -137,7 +137,7 @@ namespace TGServerService
Directory.CreateDirectory(destdir);
File.WriteAllText(path, data);
Service.CancelImpersonation();
Service.WriteInfo("Write to " + path, EventID.StaticWrite);
WriteInfo("Write to " + path, EventID.StaticWrite);
unauthorized = false;
return null;
}
@@ -152,7 +152,7 @@ namespace TGServerService
{
unauthorized = false;
Service.CancelImpersonation();
Service.WriteWarning(String.Format("Write of {0} failed! Error: {1}", path, e.ToString()), EventID.StaticRead);
WriteWarning(String.Format("Write of {0} failed! Error: {1}", path, e.ToString()), EventID.StaticRead);
return e.ToString();
}
}
@@ -191,7 +191,7 @@ namespace TGServerService
else if (Directory.Exists(path))
Program.DeleteDirectory(path);
Service.CancelImpersonation();
Service.WriteInfo("Delete of " + path, EventID.StaticDelete);
WriteInfo("Delete of " + path, EventID.StaticDelete);
unauthorized = false;
return null;
}
@@ -206,7 +206,7 @@ namespace TGServerService
{
unauthorized = false;
Service.CancelImpersonation();
Service.WriteWarning(String.Format("Delete of {0} failed! Error: {1}", path, e.ToString()), EventID.StaticRead);
WriteWarning(String.Format("Delete of {0} failed! Error: {1}", path, e.ToString()), EventID.StaticRead);
return e.ToString();
}
}