Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where form saves log? #2

Open
FeelUsM opened this issue Apr 13, 2021 · 1 comment
Open

where form saves log? #2

FeelUsM opened this issue Apr 13, 2021 · 1 comment

Comments

@FeelUsM
Copy link

FeelUsM commented Apr 13, 2021

I start form with f = form.open(keep_log=True), in text of program I write on statistics;, and then I found file xform01427.str near .ipynb file I run, but that file is void.
Where form saves log?

@tueda
Copy link
Owner

tueda commented Apr 13, 2021

As far as I remember, keep_log is the option to keep FORM's piped output (which could be in general gigantic) in memory, in order to show a proper error message when something wrong happens with FORM:

The other argument ``keep_log`` indicates whether the log from FORM is
kept and used as detailed information when an error occurs.
If the value is >= 2, it specifies the maximum number of lines for
the scrollback. The default value is False.

So, this is not what you want.

.str files are FORM's temporary files, used for storing big data that doesn't fit in memory, and will be deleted when FORM successfully exits.

FORM has the -l option to save logs, but it writes the log into the directory where the main .frm file is sitting, not in the current directory. For example,

import form

with form.open("form -l") as f:
    f.write('''
        On stats;
        Auto V p;
        L F = g_(0,p1,...,p6);
        trace4,0;
        .sort
    ''')
    print(f.read('F'))
    print(f.read("`NAME_'"))

writes the log to init.log in the directory which you can find by f.read("`NAME_'").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants