Änderung
- Doppelte File Extension wird vermieden
This commit is contained in:
parent
866676ef53
commit
07a3c208d5
Binary file not shown.
@ -341,11 +341,25 @@ namespace Eugen.ESystem.IO
|
|||||||
{
|
{
|
||||||
if (this.path[this.path.Length - 1] != System.IO.Path.DirectorySeparatorChar)
|
if (this.path[this.path.Length - 1] != System.IO.Path.DirectorySeparatorChar)
|
||||||
{
|
{
|
||||||
fileName = String.Concat(path, System.IO.Path.DirectorySeparatorChar, this.filename, ".log");
|
if (String.IsNullOrEmpty(System.IO.Path.GetExtension(this.filename)))
|
||||||
|
{
|
||||||
|
fileName = String.Concat(path, System.IO.Path.DirectorySeparatorChar, this.filename, ".log");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fileName = String.Concat(path, System.IO.Path.DirectorySeparatorChar, this.filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileName = String.Concat(this.path, this.filename, ".log");
|
if (String.IsNullOrEmpty(System.IO.Path.GetExtension(this.filename)))
|
||||||
|
{
|
||||||
|
fileName = String.Concat(this.path, this.filename, ".log");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fileName = String.Concat(this.path, this.filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -135,7 +135,7 @@ namespace Test_LogWriter
|
|||||||
logWriter1.WriteMessage("Das ist ein Test");
|
logWriter1.WriteMessage("Das ist ein Test");
|
||||||
|
|
||||||
//Variante 2 - Logdateiname wird angegeben, z.B. 'my_logfile.log'
|
//Variante 2 - Logdateiname wird angegeben, z.B. 'my_logfile.log'
|
||||||
var logWriter2 = new LogWriter(@"C:\TMP\", "my_logfile2");
|
var logWriter2 = new LogWriter(@"C:\TMP\", "my_logfile2.log");
|
||||||
logWriter2.WriteMessage("Das ist Test 2");
|
logWriter2.WriteMessage("Das ist Test 2");
|
||||||
|
|
||||||
//Variante 3 - Logdateiname wird angegeben und Header wird geschrieben
|
//Variante 3 - Logdateiname wird angegeben und Header wird geschrieben
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user