---
name: "Log::Handler::Levels"
section: "3pm"
platform: "linux"
package: "liblog-handler-perl"
version: "0.90-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Log::Handler::Levels"
---

# Log::Handler::Levels(3pm)

All levels for Log::Handler.

## NAME

Log::Handler::Levels - All levels for Log::Handler.

## DESCRIPTION

Base class for Log::Handler.

Just for internal usage and documentation.

## METHODS

### Default log level

- **debug()**

  - **info()**

  - **notice()**

  - **warning()**, **warn()**

  - **error()**, **err()**

  - **critical()**, **crit()**

  - **alert()**

  - **emergency()**, **emerg()**

  ### Checking for active levels

- **is\_debug()**

  - **is\_info()**

  - **is\_notice()**

  - **is\_warning()**, **is\_warn()**

  - **is\_error()**, **is\_err()**

  - **is\_critical()**, **is\_crit()**

  - **is\_alert()**

  - **is\_emergency()**, **is\_emerg()**

  ### Special level

- **fatal()**

  Alternative for the levels `"critical"` - `"emergency"`.

- **is\_fatal()**

  Check if one of the levels `"critical"` - `"emergency"` is active.

### Special methods

- **trace()**

  This method is very useful if you want to add a full backtrace to your message. Maybe you want to intercept unexpected errors and want to know who called `"die()"`.

  ```
      $SIG{__DIE__} = sub { $log->trace(emergency => @_) };
  ```

  By default the backtrace is logged as level `"debug"`.

  ```
      # would log with the level debug
      $log->trace('who called who');
  ```

  If you want to log with another level then you can pass the level as first argument:

  ```
      $log->trace(info => $message);
  ```

- **dump()**

  If you want to dump something then you can use `"dump()"`. The default level is `"debug"`.

  ```
      my %hash = (foo => 1, bar => 2);
      $log->dump(\%hash);
  ```

  If you want to log with another level then you can pass the level as first argument:

  ```
      $log->dump($level => \%hash);
  ```

- **die()**

  This method logs the message to the output and then call `"Carp::croak()"` with the level `"emergency"` by default.

  ```
      $log->die('an emergency error here');
  ```

  If you want to log with another level, then you can pass the level as first argument:

  ```
      $log->die(fatal => 'an emergency error here');
  ```

- **log()**

  With this method it's possible to log messages with the log level as first argument:

  ```
      $log->log(info => 'an info message');
  ```

  Is the same like

  ```
      $log->info('an info message');
  ```

  and

  ```
      $log->log('an info message');
  ```

  If you log without a level then the default level is `"info"`.

## PREREQUISITES

```
    Carp
    Data::Dumper
```

## EXPORTS

No exports.

## REPORT BUGS

Please report all bugs to \<jschulz.cpan(at)bloonix.de\>.

If you send me a mail then add Log::Handler into the subject.

## AUTHOR

Jonny Schulz \<jschulz.cpan(at)bloonix.de\>.

## COPYRIGHT

Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
