Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have difficulties with session logging and Mathematica 10. In previous versions, you could simply use AppendTo[$Echo, logfile] and AppendTo[$Output, logfile].

In Mathematica 10, appending to $Echo only works for cells in raw input format, as stated in the reference.

Appending to $Output seems not working. Log file is always empty.

My questions:

a) How can I force all input cells to be in "raw input format", without converting the cells by the menu?

b) What's wrong with my AppendTo[$Output]?

oldout = $Output;
logfile = OpenWrite[FileNameJoin[{$TemporaryDirectory, "math.log"}],
    FormatType -> InputForm];
AppendTo[$Output, logfile];
AppendTo[$Echo, logfile];
First@logfile

(* tests, $Echo works, if cell is converted to raw input format *)
2+2
Expand[(a + b)^3]
Factor[z^5 - 1]
N[Pi, 24]
Close[logfile];
$Echo={};
$Output = oldout;
FilePrint[First@logfile]
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.