Skip to content

Commit

Permalink
Allow to use debugger programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
BR0kEN- committed May 9, 2016
1 parent b5c73e8 commit 5dcb1e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ new \Behat\DebugExtension\Message('comment', 2, [
'Read documentation for this class to know how to use it.',
]);
```

### Programmatic usage

```shell
export BEHAT_DEBUG=true
```

This environment variable tells that messages should be printed in any way.
2 changes: 1 addition & 1 deletion src/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function debug(array $strings, array $placeholders = [])
// Mark debug message.
array_unshift($strings, '<question>DEBUG:</question>');

$_SESSION[__TRAIT__][] = new Message('comment', 4, $strings, $placeholders, false);
$_SESSION[__TRAIT__][] = new Message('comment', 4, $strings, $placeholders, (bool) getenv('BEHAT_DEBUG'));
}

/**
Expand Down

0 comments on commit 5dcb1e0

Please sign in to comment.