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: Parameters: - $config (
OCP\IConfig
) - $formatter (
Symfony\Component\Console\Formatter\OutputFormatterInterface
)
- $config (
-
public
OC\Console\TimestampFormatter::
setDecorated
($decorated)¶ - Sets the decorated flag.
Source: 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: 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: Parameters: - $name (string)
Returns: bool
-
public
OC\Console\TimestampFormatter::
getStyle
($name)¶ - Gets style options from style with specified name.
Source: 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: 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”