Skip to content

Commit

Permalink
Suggested change
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed May 12, 2022
1 parent 037b286 commit f558976
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sanic/mixins/runner.py
Expand Up @@ -424,12 +424,15 @@ def _helper(

self.motd(self.serve_location)

if sys.stdout and sys.stdout.isatty() and not self.state.is_debug:
error_logger.warning(
f"{Colors.YELLOW}Sanic is running in PRODUCTION mode. "
"Consider using '--debug' or '--dev' while actively "
f"developing your application.{Colors.END}"
if not self.state.is_debug:
message = (
"Sanic is running in PRODUCTION mode. Consider using "
"'--debug' or '--dev' while actively developing your "
"application."
)
if sys.stdout and sys.stdout.isatty():
message = "".join([Colors.YELLOW, message, Colors.END])
error_logger.warning(message)

# Register start/stop events
for event_name, settings_name, reverse in (
Expand Down

0 comments on commit f558976

Please sign in to comment.