You are here

function feeds_dbg in Feeds 8.2

Same name and namespace in other branches
  1. 6 feeds.module \feeds_dbg()
  2. 7.2 feeds.module \feeds_dbg()
  3. 7 feeds.module \feeds_dbg()

Logs to a file like /tmp/feeds_my_domain_org.log in temporary directory.

Related topics

2 calls to feeds_dbg()
FeedsHTTPFetcher::request in lib/Drupal/feeds/Plugin/feeds/fetcher/FeedsHTTPFetcher.php
Implements FeedsFetcher::request().
PuSHEnvironment::log in lib/Drupal/feeds/PuSHEnvironment.php
Implements PuSHSubscriberEnvironmentInterface::log().

File

./feeds.module, line 767
Feeds - basic API functions and hook implementations.

Code

function feeds_dbg($msg) {
  if (variable_get('feeds_debug', FALSE)) {
    if (!is_string($msg)) {
      $msg = var_export($msg, TRUE);
    }
    $filename = trim(str_replace('/', '_', $_SERVER['HTTP_HOST'] . base_path()), '_');
    $handle = fopen("temporary://feeds_{$filename}.log", 'a');
    fwrite($handle, gmdate('c') . "\t{$msg}\n");
    fclose($handle);
  }
}