> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usetero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accidental debug statements

> Temporary debugging output that shipped to production

Accidental debug statements are developer-authored messages that do not describe application behavior, system state, or user activity. Examples include `console.log("here")`, `print("debug")`, and `logger.info("asdf")`.

Tero classifies by message content; these statements appear at `DEBUG`, `INFO`, or any other severity level.

## Signals

* Placeholder messages such as `got here`, `hello world`, `testing`, or `asdf`.
* Explicit cleanup notes such as `TODO remove`.
* Bare variable dumps such as `x = 42`.
* Profanity or informal phrases used as temporary debugging markers.
* Messages with no stable operational meaning.

## Example

<Tabs>
  <Tab title="Before">
    ```json theme={null}
    {
      "@timestamp": "2024-01-15T10:30:00Z",
      "service.name": "checkout-api",
      "severity_text": "DEBUG",
      "body": "got here"
    }
    ```
  </Tab>

  <Tab title="After">
    Dropped.
  </Tab>
</Tabs>

Tero generates a policy to drop this specific log event:

```yaml theme={null}
id: drop-debug-got-here-checkout-api
name: Drop got-here debug log from checkout-api
description: Accidental debug statement that shipped to production.
log:
  match:
    - resource_attribute: service.name
      exact: checkout-api
    - log_field: body
      exact: "got here"
  keep: none
```

## Recommended enforcement

<Card title="Open PRs" icon="code-pull-request" href="/policies/enforcement/open-prs" horizontal>
  Remove accidental debug statements from the codebase.
</Card>

Fix this at the source: the statement should not exist in production code.

## Detection notes

* Tero evaluates message content rather than severity.
* Tero flags common debug phrases, random character strings, cleanup notes, and bare variable dumps.
* Detection is conservative for this category: Tero flags only logs that are clear accidents.
* Tero excludes legitimate verbose logging when the message has operational meaning.
