Skip to content

transcript.start behaviour #1514

@mkundu1

Description

@mkundu1
import ansys.fluent.core as pyfluent
solver = pyfluent.launch_fluent(show_gui=True, start_transcript=False)
solver.transcript.start(file_path="a.trn")  # write to both file and stdout
solver.transcript.stop()
solver.transcript.start(file_path="a.trn", write_to_interpreter=False)  # write to file only
solver.transcript.stop()
solver.transcript.start(file_path="a.trn")  #  write to file only

We can make it to behave like Python logging module:

import logging
logging.warning("abc")  # writes to stdout only
import logging
logging.basicConfig(filename="a.log")
logging.warning("abc")  # writes to file only

To write to both file and stdout, the logging module requires additional configuration.

So, in our case, we can do

transcript.start()  # write to stdout only
transcript.start(file_path="a.trn")  # write to file only
transcript.start(file_path="a.trn", write_to_stdout=True)  # write to both file and stdout

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions