Re: Redirecting ex.err to STDOUT

new topic     » goto parent     » topic index » view thread      » older message » newer message

duke normandin wrote:
> I'll be using Euphoria on both FreeBSD and winDoze -- so your code
> suggestion is good stuff for a start. However, I want to see the contents
> of ex.err on-screen if I put the script in "DEBUG" mode -- something like
> Perl / PHP do. Ant thoughts? TIA...

include machine.e
object IsDebugMode
IsDebugMode = getenv("DEBUGMODE")
if equal(IsDebugMode, "on") then
    if platform() > 2 then
        crash_file("/dev/tty")
    else
        crash_file("con:")
    end if
    crash_message(" ** PROGRAM CRASHED ** at ")
end if


Then run the script with 
(windows)
  SET DEBUGMODE=on 

or
(bash)
  DEBUGMODE=on; export DEBUGMODE

to get the messages on screen. Set it 'off' (or don't set it) to get the ex.err
file instead.

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu