-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Dub - Switched to `gogga` for logging * birchwood.logging - Added logging facilities * Client - Use new logging facility * Receiver - Use new logging facility * Messages - Use new logging facility * Messages - Cleaned up * Dub - Bumped * Dub - Bumped * Revert "Dub" This reverts commit a7049d1. * Reapply "Dub" This reverts commit 44b9b19.
- Loading branch information
Showing
5 changed files
with
91 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Internal logging facilities | ||
*/ | ||
module birchwood.logging; | ||
|
||
import gogga; | ||
import gogga.extras; | ||
import dlog.basic : Level, FileHandler; | ||
import std.stdio : stdout; | ||
|
||
/** | ||
* Globally available logger | ||
*/ | ||
package __gshared GoggaLogger logger; | ||
|
||
/** | ||
* Initializes a logger instance | ||
* globally | ||
*/ | ||
__gshared static this() | ||
{ | ||
logger = new GoggaLogger(); | ||
|
||
GoggaMode mode; | ||
|
||
// TODO: Add flag support | ||
version(DBG_VERBOSE_LOGGING) | ||
{ | ||
mode = GoggaMode.RUSTACEAN; | ||
} | ||
else | ||
{ | ||
mode = GoggaMode.SIMPLE; | ||
} | ||
|
||
logger.mode(mode); | ||
|
||
Level level = Level.DEBUG; | ||
|
||
// TODO: Add flag support | ||
// version(DBG_DEBUG_LOGGING) | ||
// { | ||
// level = Level.DEBUG; | ||
// } | ||
// else | ||
// { | ||
// level = Level.INFO; | ||
// } | ||
|
||
|
||
logger.setLevel(level); | ||
logger.addHandler(new FileHandler(stdout)); | ||
} | ||
|
||
// Bring in helper methods | ||
mixin LoggingFuncs!(logger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters