1 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel namespaces accessors combinators make smtp
4 debugger prettyprint io io.streams.string io.encodings.utf8
6 mason.common mason.platform mason.config ;
9 : prefix-subject ( str -- str' )
10 [ "mason on " % platform % ": " % % ] "" make ;
12 : email-status ( body subject -- )
14 builder-from get >>from
15 builder-recipients get >>to
16 swap prefix-subject >>subject
22 { status-clean [ "clean" ] }
23 { status-dirty [ "dirty" ] }
24 { status-error [ "error" ] }
28 "report" utf8 file-contents subject email-status ;
30 : email-error ( error callstack -- )
32 "Fatal error on " write host-name print nl
33 [ error. ] [ callstack. ] bi*
34 ] with-string-writer "fatal error"