Skip to content

Commit

Permalink
utils: Add debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
underyx committed Jun 17, 2020
1 parent dbb01c8 commit e3f1fce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions semgrep_agent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@
def debug_echo(text: str) -> None:
"""Print debug messages with context-specific debug formatting."""
if os.getenv("GITHUB_ACTIONS"):
text = "\n".join("::debug::" + line for line in text.splitlines())
click.echo(text)
prefix = "::debug::"
elif os.getenv("SEMGREP_AGENT_DEBUG"):
prefix = "== [DEBUG] "
else:
return
text = "\n".join(prefix + line for line in text.splitlines())
click.echo(text)

0 comments on commit e3f1fce

Please sign in to comment.