# wrBadgeLog

> Logs a message to the browser console behind a coloured badge. `wrBadgeWarn()` and `wrBadgeError()` do the same at their level.

Source: https://ngwr.dev/reference/utils/wr-badge-log  
Kind: Util  
Updated in v16  
Optional

## Usage

```angular-ts
import { wrBadgeLog } from 'ngwr/utils';

wrBadgeLog('SAVED', '#10b981', 'profile updated');
```

## Warnings and errors

The same pill through `console.warn` and `console.error`, so the stack trace and the console's level filters still work.

```typescript
import { wrBadgeError, wrBadgeWarn } from 'ngwr/utils';

wrBadgeWarn('CACHE', '#f59e0b', 'profile is stale');
wrBadgeError('SAVE', '#ef4444', new Error('profile not saved'));
```

## API

| Name | Description | Type | Default |
| --- | --- | --- | --- |
| `wrBadgeLog(badge, color, message)` | Logs `message` after a `badge` pill. `color` paints the pill's border and text, not a fill. | `(badge, color, message) => void` | `—` |
| `wrBadgeWarn(badge, color, message)` | The same through `console.warn`. | `(badge, color, message) => void` | `—` |
| `wrBadgeError(badge, color, message)` | The same through `console.error`. | `(badge, color, message) => void` | `—` |

## See also

- [wrResolveCssColor](https://ngwr.dev/reference/utils/wr-resolve-css-color) — Resolves a CSS colour, such as a var() or light-dark(), to a value a canvas can paint with.
