mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR added Debug::header() for fun debugging.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@82759 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ce9a4b158d
commit
0609a8e9cd
@ -165,6 +165,24 @@ class Debug {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep track of how many headers have been sent
|
||||||
|
static $headerCount = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a debug message in an HTTP header. Only works if you are
|
||||||
|
* on Dev, and headers have not yet been sent.
|
||||||
|
*
|
||||||
|
* @param string $msg
|
||||||
|
* @param string $prefix (optional)
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
static function header($msg, $prefix) {
|
||||||
|
if (Director::isDev() && !headers_sent()) {
|
||||||
|
self::$headerCount++;
|
||||||
|
header('SS-'.self::$headerCount.($prefix?'-'.$prefix:'').': '.$msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log to a standard text file output.
|
* Log to a standard text file output.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user