Skip to content

Commit

Permalink
add logStyle.throwError
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed Jun 15, 2023
1 parent b97ed34 commit e70ff45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flixel/system/debug/log/LogStyle.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class LogStyle
*/
public var callbackFunction:()->Void;

/**
* Whether an error is thrown when this LogStyle is used
* @since 5.4.0
*/
public var throwError:Bool = false;

/**
* Create a new LogStyle to be used in conjunction with `FlxG.log.advanced()`
*
Expand Down
5 changes: 5 additions & 0 deletions flixel/system/frontEnds/LogFrontEnd.hx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ class LogFrontEnd
{
style.callbackFunction();
}

if (style.throwError)
{
throw style.toLogString(data);
}
}
#end
}
Expand Down

0 comments on commit e70ff45

Please sign in to comment.