GoggaMode

- Added new mode `RUSTACEAN_SIMPLE`

GoggaTransform

- Added support for `RUSTACEAN_SIMPLE` mode
This commit is contained in:
Tristan B. Velloza Kildaire 2023-11-22 11:49:39 +02:00
parent 034b4cebd4
commit 08aa1d6c0c
1 changed files with 16 additions and 2 deletions

View File

@ -26,7 +26,12 @@ public enum GoggaMode
/**
* Rustacean mode is: `[<LEVEL>] (<filePath>/<functionName>:<lineNumber>) <message>`
*/
RUSTACEAN
RUSTACEAN,
/**
* Simple rustacean mode is: `[<LEVEL>] (<functionName>:<lineNumber>) <message>`
*/
RUSTACEAN_SIMPLE
}
/**
@ -89,12 +94,21 @@ public class GoggaTransform : MessageTransform
/**
* Rustacean mode is: `[<LEVEL>] (<filePath>/<functionName>:<lineNumber>) <message>`
*/
else
else if(mode == GoggaMode.RUSTACEAN)
{
finalOutput = cast(string)debugColor(to!(string)(level)~"\t", level);
finalOutput ~= cast(string)(colorSrc(context[1]~"/"~context[4]~":"~context[2]~" "));
finalOutput ~= text~"\n";
}
/**
* Simple rustacean mode is: `[<LEVEL>] (<functionName>:<lineNumber>) <message>`
*/
else if(mode == GoggaMode.RUSTACEAN_SIMPLE)
{
finalOutput = cast(string)debugColor(to!(string)(level)~"\t", level);
finalOutput ~= cast(string)(colorSrc(context[4]~":"~context[2]~" "));
finalOutput ~= text~"\n";
}
return finalOutput;
}