> For the complete documentation index, see [llms.txt](https://smuddgge.gitbook.io/squishy-library/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smuddgge.gitbook.io/squishy-library/common/logger.md).

# 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 %}
