-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
11 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# error: holds the error handling things | ||
import sys | ||
import flax.common | ||
from colorama import Fore, Style | ||
|
||
|
||
def error(msg, exit_status=1, prefix="\n'"): | ||
def error(msg, exit_status=1, prefix="'"): | ||
"""error: errors with msg and optional exit_status""" | ||
print(prefix + str(msg), file=sys.stderr) | ||
print(Fore.RED + prefix + str(msg) + Style.RESET_ALL, file=sys.stderr) | ||
exit(exit_status) | ||
|
||
|
||
def debug(msg, prefix='\n"'): | ||
def debug(msg, prefix='"'): | ||
"""debug: log a debug message to stderr""" | ||
if flax.common.DEBUG: | ||
print(prefix + str(msg), file=sys.stderr) | ||
print(Fore.YELLOW + prefix + str(msg) + Style.RESET_ALL, file=sys.stderr) |
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