diff options
author | Nathan Gass | 2022-06-22 10:36:44 +0200 |
---|---|---|
committer | Nathan Gass | 2022-06-22 10:36:44 +0200 |
commit | c8327bdc857ea26ec576d5c5d1070dcfd815c033 (patch) | |
tree | 9a7ca9296656982e4171d113341639b7322a3d0c /it_debug.class | |
parent | 72010f5b4d1aee57e1ace054b91ab579d630366d (diff) | |
download | itools-c8327bdc857ea26ec576d5c5d1070dcfd815c033.tar.gz itools-c8327bdc857ea26ec576d5c5d1070dcfd815c033.tar.bz2 itools-c8327bdc857ea26ec576d5c5d1070dcfd815c033.zip |
ED output to stderror if IT_ED_STDERR is set
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/it_debug.class b/it_debug.class index a504be8..c4bc8db 100644 --- a/it_debug.class +++ b/it_debug.class @@ -51,6 +51,14 @@ function debug($text, $level = 0) } } +static function echo($args) +{ + if (getenv('IT_ED_STDERR')) + fputs(STDERR, self::dump($args)); + else + echo self::dump($args); +} + /** * Get source line of grandparent calling this function * @param $stacksoffs go up an extra $stacksoffs levels |