---
name: "Jifty::Plugin::TestServerWarnings"
section: "3pm"
platform: "linux"
package: "libjifty-perl"
version: "1.10518+dfsg-2"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/Jifty::Plugin::TestServerWarnings"
---

# Jifty::Plugin::TestServerWarnings(3pm)

Stores server warnings away for later fetching

## NAME

Jifty::Plugin::TestServerWarnings - Stores server warnings away for later fetching

## SYNOPSIS

\# In your jifty config.yml under the framework section:

```
  Plugins:
    - TestServerWarnings:
        clear_screen: 1
```

## DESCRIPTION

This plugin add a new appender Jifty::Plugin::TestServerWarnings::Appender on the first request it sees, which stores away all messages it receives.  It also removes the default "Screen" appender unless clear\_screen in config.yml is set to be false or env TEST\_VERBOSE is true.

The warnings can be retrieved by a client-side process by calling  "decoded\_warnings" with a base URI to the server.

This plugin is automatically added for all jifty tests.

## METHODS

### init

set clear\_screen to 1 if the clear\_screen in config.yml is set to be true, if it's not set at all, set it to 1 if TEST\_VERBOSE is set to be true.

### new\_request

On the first call to new\_request, the plugin adjusts the appenders. This causes it to only have effect if it is run in a forked server process, not in a test process.  If `"TEST_VERBOSE"` is set, it does not remove the Screen appender.

### add\_warnings WARN, WARN, ..

Takes the given warnings, and stores them away for later reporting.

### stashed\_warnings

Returns the stored warnings, as a list.  This does not clear the list, unlike "encoded\_warnings" or "decoded\_warnings".

### encoded\_warnings

Returns the stored warnings, encoded using Storable.  This also clears the list of stashed warnings.

### decoded\_warnings URI

Given the URI to a jifty server with this plugin enabled, retrieves and decodes the stored warnings, returning them.  This will also clear the server's stored list of warnings.
