Issue
Code backup
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
//Simple function for create log message
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
public class Test
|
||||
{
|
||||
static void Log(string message,
|
||||
[CallerFilePath] string file = null,
|
||||
[CallerLineNumber] int line = 0)
|
||||
{
|
||||
Console.WriteLine("{0} ({1}): {2}", Path.GetFileName(file), line, message);
|
||||
}
|
||||
|
||||
static void Main()
|
||||
{
|
||||
Log("Hello, world");
|
||||
Log("This is the next line");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Output:
|
||||
|
||||
Test.cs (16): Hello, world
|
||||
Test.cs (17): This is the next line
|
||||
*/
|
||||
Reference in New Issue
Block a user