Top Description Constructors Methods
ch.qos.logback.core.pattern.util

public Class AlmostAsIsEscapeUtil

extends RestrictedEscapeUtil
Class Inheritance
Imports
ch.qos.logback.core.CoreConstants, ch.qos.logback.core.rolling.helper.FileNamePattern

This implementation is intended for use in FileNamePattern.
Author
Ceki Gülcü

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
escape(String escapeChars, StringBuffer buf, char next, int pointer)

Overrides ch.qos.logback.core.pattern.util.RestrictedEscapeUtil.escape.

Implements ch.qos.logback.core.pattern.util.IEscapeUtil.escape.

Do not perform any character escaping, except for '%', and ')'.

Constructor Detail

AlmostAsIsEscapeUtilback to summary
public AlmostAsIsEscapeUtil()

Method Detail

escapeback to summary
public void escape(String escapeChars, StringBuffer buf, char next, int pointer)

Overrides ch.qos.logback.core.pattern.util.RestrictedEscapeUtil.escape.

Implements ch.qos.logback.core.pattern.util.IEscapeUtil.escape.

Do not perform any character escaping, except for '%', and ')'.

Here is the rationale. First, filename patterns do not include escape combinations such as \r or \n. Moreover, characters which have special meaning in logback parsers, such as '{', or '}' cannot be part of file names (so me thinks). The left parenthesis character has special meaning only if it is preceded by %. Thus, the only characters that needs escaping are '%' and ')'.

Note that this method assumes that it is called after the escape character has been consumed.