-
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.
fixed field rename with null-safe access
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package classes; | ||
|
||
import haxe.Exception; | ||
import haxe.PosInfos; | ||
|
||
class Log { | ||
@inject private static var logger:ILogger; | ||
|
||
public static inline function fatal(text:String, ?e:Exception, ?pos:PosInfos):Void { | ||
logger?.fatal(text, e, pos); | ||
} | ||
|
||
public static inline function error(text:String, ?e:Exception, ?pos:PosInfos):Void { | ||
logger?.error(text, e, pos); | ||
} | ||
|
||
public static inline function warn(text:String, ?e:Exception, ?pos:PosInfos):Void { | ||
logger?.warn(text, e, pos); | ||
} | ||
|
||
public static inline function info(text:String, ?e:Exception, ?pos:PosInfos):Void { | ||
logger?.info(text, e, pos); | ||
} | ||
|
||
public static inline function debug(text:String, ?e:Exception, ?pos:PosInfos):Void { | ||
logger?.debug(text, e, pos); | ||
} | ||
|
||
public static inline function logVersion():Void { | ||
debug("Version: 1.0"); | ||
} | ||
} | ||
|
||
interface ILogger { | ||
function fatal(text:String, ?e:Exception, ?pos:PosInfos):Void; | ||
|
||
function error(text:String, ?e:Exception, ?pos:PosInfos):Void; | ||
|
||
function warn(text:String, ?e:Exception, ?pos:PosInfos):Void; | ||
|
||
function info(text:String, ?e:Exception, ?pos:PosInfos):Void; | ||
|
||
function debug(text:String, ?e:Exception, ?pos:PosInfos):Void; | ||
} |