- Added new Context class for future version
This commit is contained in:
Tristan B. Velloza Kildaire 2023-03-01 09:14:14 +02:00
parent d2135062f3
commit 5a503fb14c
1 changed files with 48 additions and 0 deletions

48
source/dlog/context.d Normal file
View File

@ -0,0 +1,48 @@
module dlog.context;
/**
* Context that is passed in with the call to log
*/
public class Context
{
private CompilationInfo lineInfo;
this()
{
}
public final void setLineInfo(CompilationInfo lineInfo)
{
this.lineInfo = lineInfo;
}
public final CompilationInfo getLineInfo()
{
return lineInfo;
}
}
/**
* Information obtained during compilation time (if any)
*/
public struct CompilationInfo
{
private string fullFilePath;
private string file;
private ulong line;
private string moduleName;
private string functionName;
private string prettyFunctionName;
this(string fullFilePath, string file, ulong line, string moduleName, string functionName, string prettyFunctionName)
{
this.fullFilePath = fullFilePath;
this.file = file;
this.line = line;
this.moduleName = moduleName;
this.functionName = functionName;
this.prettyFunctionName = prettyFunctionName;
}
}