# Logging | Toshiki's Note
Display formatted output for code examples.
Author: Anda Toshiki
Keywords: Toshiki, Anda Toshiki, andatoshiki, GitHub, GitHub action, Vitepress, Vite, Notebook, Knowledge base, Programming, Programming Notes, Academic, Personal, Notebook, Productivity, Journal, Note-taking, Markdown, Notepad, Organization, Tutorial

Skip to content

####

# Logging ​

Author:Anda Toshiki
Updated:a minute ago
Words:152
Reading:1 min

When you first see a Twoslash code example with an inline compiler error, you instinctively trust that the compiler error is correct because the design shows that it is not a part of the code sample. The logging tools lets you do that, but abuses the systemic trust because your code is not being evaluated to generate the logs.

This feature is effectively a facade, people will trust your output and it will look better.

## `@log:`, `@warn:`, `@error:` ​

The names are based on the functions on the `console` object:

outputmarkdown
ts

    tsconsole.log('Hello log')Hello log console.warn('Hello warn')Hello warn console.error('Hello error')Hello error
    tsconsole.log('Hello log')Hello log console.warn('Hello warn')Hello warn console.error('Hello error')Hello error

1
md

    ```ts twoslash
    console.log('Hello log')
    // @log: Hello log

    console.warn('Hello warn')
    // @warn: Hello warn

    console.error('Hello error')
    // @error: Hello error
    ```

    ```ts twoslash
    console.log('Hello log')
    // @log: Hello log

    console.warn('Hello warn')
    // @warn: Hello warn

    console.error('Hello error')
    // @error: Hello error
    ```

1
2
3
4
5
6
7
8
9
10