# Logger

<pre class="language-java"><code class="lang-java"><strong>// There are a few constructures you can choose from.
</strong><strong>Logger logger = new Logger("com.package", "prefix");
</strong><strong>logger.info("Hello there!");
</strong></code></pre>

```
<root_format> prefix Hello there!
```

## Features

{% tabs %}
{% tab title="Prefixes" %}

<pre class="language-java"><code class="lang-java"><strong>Logger processLogger = logger.extend(" [Process]");
</strong>
processLogger.info("Something is running.");
</code></pre>

```
<root_format> [Log] [Process] Something is running.
```

{% endtab %}

{% tab title="Debuging" %}

```java
logger.setLevel(Level.DEBUG);
logger.debug("Some info about what's going on.");
```

Sometimes your root logger won't let you see these messages.\
You have two options.

### Change the root logger

```java
Logger.setRootLoggerLevel(Level.DEBUG);
```

### Send debug messages through Info

{% code overflow="wrap" %}

```java
// This will still check if the level is DEBUG.
// However, when it sends it, it will be through info so you dont 
// have to change the root logger.
// Remember the root logger may be used by a lot more than just your software.
logger.setDebugForwarding(true);
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smuddgge.gitbook.io/squishy-library/common/logger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
