Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
- Added stdout-based handler
- Added `DEBUG` enum member + mapping
  • Loading branch information
deavmi committed Apr 10, 2024
1 parent 1878567 commit 5ad2e67
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions source/tlang/misc/logging.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ public enum DebugType
{
INFO,
WARNING,
ERROR
ERROR,
DEBUG
}


Expand All @@ -20,7 +21,7 @@ private GoggaLogger logger;
static this()
{
logger = new GoggaLogger();
logger.mode(GoggaMode.SIMPLE);
logger.mode(GoggaMode.RUSTACEAN);

import dlog.basic : Level;
logger.setLevel(Level.DEBUG);
Expand All @@ -35,7 +36,11 @@ static this()
// TODO: Change to actually use error, etc. directkly on GoggaLogger
public void gprintln(messageT)(messageT message, DebugType debugType = DebugType.INFO)
{
if(debugType == DebugType.INFO)
if(debugType == DebugType.DEBUG)
{
logger.dbg(message);
}
else if(debugType == DebugType.INFO)
{
logger.info(message);
}
Expand Down

0 comments on commit 5ad2e67

Please sign in to comment.