Skip to content

Commit

Permalink
BasicLogger
Browse files Browse the repository at this point in the history
- Documented
  • Loading branch information
deavmi committed Apr 10, 2024
1 parent 1d57ab1 commit dac2318
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions source/dlog/basic.d
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,20 @@ private class LevelFilter : Filter
}
}

/**
* A basic logger which has support
* for log levels
*/
public class BasicLogger : Logger
{
/**
* The current log level
*/
private Level level;

/**
* Constructs a new `BasicLogger`
*/
this()
{
// Attach a new level-filter
Expand All @@ -229,11 +239,24 @@ public class BasicLogger : Logger
addFilter(new LevelFilter(&level));
}

/**
* Sets the log level
*
* Params:
* level = the new
* level
*/
public final void setLevel(Level level)
{
this.level = level;
}

/**
* Obtains the current log
* level
*
* Returns: the current level
*/
public final Level getLevel()
{
return this.level;
Expand Down

0 comments on commit dac2318

Please sign in to comment.