<commit_before># Consolation

## Yet another safe JS browser console

- Ensures `console.log` doesn't cause errors in browsers with no console
- Lets you enable/disable console logging (using `console.enabled = boolean`)
- Supports all console methods [documented by Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/console)
- If any console method was overlooked, it will be delegated to the original console object (bypassing the `enabled` check)

## Try it out

After including the JS file, paste the following in a file and include it on your page:

```javascript
console.enabled = true;

function go_beedogs_go() {
  console.log('I heart beedogs', 42, {we: 'rock you', yes: function(){ return 'we do';}});
}

go_beedogs_go();

console.log('here we are in the top level...');
```

Then paste the following (uncommented) in your browser's JS console.

```javascript
console.warn('hi there', {number: 9});
```
<commit_msg>Add compatibility note<commit_after># Consolation

## Yet another safe JS browser console

- Ensures `console.log` doesn't cause errors in browsers with no console
- Lets you enable/disable console logging (using `console.enabled = boolean`)
- Supports all console methods [documented by Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/console)
- If any console method was overlooked, it will be delegated to the original console object (bypassing the `enabled` check)

Tested in Chrome, Firefox and Safari. Works best in Chrome.

## Try it out

After including the JS file, paste the following in a file and include it on your page:

```javascript
console.enabled = true;

function go_beedogs_go() {
  console.log('I heart beedogs', 42, {we: 'rock you', yes: function(){ return 'we do';}});
}

go_beedogs_go();

console.log('here we are in the top level...');
```

Then paste the following (uncommented) in your browser's JS console.

```javascript
console.warn('hi there', {number: 9});
```

{'fraction_non_alphanumeric': 0.11725206611570248, 'fraction_numerical': 0.0030991735537190084, 'mean_word_length': 4.730769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3046795', 'n_tokens_mistral': 589, 'n_tokens_neox': 554, 'n_words': 236}