denoland / denoland/std

Rework ConsoleHandler to use native console methods

Open
#2,645 0 comments 0 reactions 0 assignees View on GitHub
log
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

When using the `log` module with Deno Deploy, the output is not "native" in the dashboard:

![Screenshot 2022-09-12 at 21-21-33 actions - Project - Deploy Redacted](https://user-images.githubusercontent.com/817508/189738857-16fdcd39-6af4-420f-9974-ab9e3fdc9bf4.png)

**Describe the solution you'd like**

Deno Deploy provides a clean UI for logs outputed with the `debug`, `info`, `warn`, `error` methods, what about using those by default in `ConsoleHandler`?

![Screenshot 2022-09-12 at 21-22-13 actions - Project - Deploy Redacted](https://user-images.githubusercontent.com/817508/189739275-eab8be5e-ac0e-40d0-8338-6a03dd60280a.png)

**Describe alternatives you've considered**

The `ConsoleHandler` can be useful but in a terminal, what about renaming it `TerminalHandler` and creating a new `ConsoleHandler`?

- `TerminalHandler`: always outputs with `console.log` and formats data by itself, like the current `ConsoleHandler`.
- `ConsoleHandler`: outputs with the appropriate `console.*` methods, lets Deno Deploy handle the formatting.

The only drawback I can see is the missing `critical` method in the native `console` API.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.