TimestampFormatter

class OC\Console\TimestampFormatter
Source:lib/private/Console/TimestampFormatter.php#30
Implements:Symfony\Component\Console\Formatter\OutputFormatterInterface

Properties

protected static property OC\Console\TimestampFormatter::$config
Source:lib/private/Console/TimestampFormatter.php#32
Type:\OCP\IConfig
protected static property OC\Console\TimestampFormatter::$formatter
Source:lib/private/Console/TimestampFormatter.php#35
Type:\Symfony\Component\Console\Formatter\OutputFormatterInterface

Methods

public OC\Console\TimestampFormatter::__construct($config, $formatter)
Source:

lib/private/Console/TimestampFormatter.php#41

Parameters:
  • $config (OCP\IConfig)
  • $formatter (Symfony\Component\Console\Formatter\OutputFormatterInterface)
public OC\Console\TimestampFormatter::setDecorated($decorated)
Sets the decorated flag.
Source:

lib/private/Console/TimestampFormatter.php#51

Parameters:
  • $decorated (bool) Whether to decorate the messages or not
public OC\Console\TimestampFormatter::isDecorated()
Gets the decorated flag.
Source:lib/private/Console/TimestampFormatter.php#60
Returns:bool true if the output will decorate messages, false otherwise
public OC\Console\TimestampFormatter::setStyle($name, $style)
Sets a new style.
Source:

lib/private/Console/TimestampFormatter.php#70

Parameters:
  • $name (string) The style name
  • $style (Symfony\Component\Console\Formatter\OutputFormatterStyleInterface) The style instance
public OC\Console\TimestampFormatter::hasStyle($name)
Checks if output formatter has style with specified name.
Source:

lib/private/Console/TimestampFormatter.php#80

Parameters:
  • $name (string)
Returns:

bool

public OC\Console\TimestampFormatter::getStyle($name)
Gets style options from style with specified name.
Source:

lib/private/Console/TimestampFormatter.php#91

Parameters:
  • $name (string)
Returns:

\Symfony\Component\Console\Formatter\OutputFormatterStyleInterface

Throws:

\InvalidArgumentException When style isn’t defined

public OC\Console\TimestampFormatter::format($message)
Formats a message according to the given styles.
Source:

lib/private/Console/TimestampFormatter.php#102

Parameters:
  • $message (string) The message to style
Returns:

string The styled message, prepended with a timestamp using the log timezone and dateformat, e.g. “2015-06-23T17:24:37+02:00”