You are here

interface LoggerInterface in Ultimate Cron 8.2

Defines a logger method.

Hierarchy

Expanded class hierarchy of LoggerInterface

All classes that implement LoggerInterface

File

src/Logger/LoggerInterface.php, line 13

Namespace

Drupal\ultimate_cron\Logger
View source
interface LoggerInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface, PluginFormInterface {

  /**
   * Returns the default configuration.
   *
   * @return mixed
   */
  public function defaultConfiguration();

  /**
   * Factory method for creating a new unsaved log entry object.
   *
   * @param string $name
   *   Name of the log entry (name of the job).
   *
   * @return LogEntry
   *   The log entry.
   */
  public function factoryLogEntry($name);

  /**
   * Create a new log entry.
   *
   * @param string $name
   *   Name of the log entry (name of the job).
   * @param string $lock_id
   *   The lock id.
   * @param string $init_message
   *   (optional) The initial message for the log entry.
   * @param int $log_type
   *   (optional) The log_type for the log entry.
   *
   * @return LogEntry
   *   The log entry created.
   */
  public function createEntry($name, $lock_id, $init_message = '', $log_type = ULTIMATE_CRON_LOG_TYPE_NORMAL);

  /**
   * Load latest log entry for multiple jobs.
   *
   * This is the fallback method. Loggers should implement an optimized
   * version if possible.
   *
   * @param array $jobs
   *   Jobs for which the log entries should be loaded.
   * @param array $log_types
   *   Type of log messages to load.
   */
  public function loadLatestLogEntries(array $jobs, array $log_types);

  /**
   * Load a log.
   *
   * @param string $name
   *   Name of log.
   * @param string $lock_id
   *   Specific lock id.
   *
   * @return \Drupal\ultimate_cron\Logger\LogEntry
   *   Log entry
   */
  public function load($name, $lock_id = NULL, array $log_types = [
    ULTIMATE_CRON_LOG_TYPE_NORMAL,
  ]);

  /**
   * Get page with log entries for a job.
   *
   * @param string $name
   *   Name of job.
   * @param array $log_types
   *   Log types to get.
   * @param int $limit
   *   (optional) Number of log entries per page.
   *
   * @return array
   *   Log entries.
   */
  public function getLogEntries($name, array $log_types, $limit = 10);

  /**
   * Saves a log entry.
   *
   * @param \Drupal\ultimate_cron\Logger\LogEntry $log_entry
   *   The log entry to save.
   */
  public function save(LogEntry $log_entry);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
LoggerInterface::createEntry public function Create a new log entry. 1
LoggerInterface::defaultConfiguration public function Returns the default configuration. Overrides ConfigurableInterface::defaultConfiguration
LoggerInterface::factoryLogEntry public function Factory method for creating a new unsaved log entry object. 1
LoggerInterface::getLogEntries public function Get page with log entries for a job. 2
LoggerInterface::load public function Load a log. 2
LoggerInterface::loadLatestLogEntries public function Load latest log entry for multiple jobs. 1
LoggerInterface::save public function Saves a log entry. 2
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2