Skip to content

TelescopeControl log files don't get contents until closed #4786

@10110111

Description

@10110111

I was debugging an Lx200 server, using Stellarium as a client, and it was very puzzling to have an empty log_TelescopeServer1.txt all the way until I finally closed Stellarium.

It appears that the log system is based on QFile that's opened with QFile::Unbuffered, on top of which a QTextStream is layered, and this one is always buffered. Previously the log output was done with endl at the end, which, according to the docs, writes \r\n on Windows and \n on other platforms (provided the file is opened with QFile::Text, which it is), after which it flushes the stream. But since e8d67bc these endl were replaced by a kludge of StelUtils::getEndLineChar(), which of course only writes the line ending but doesn't flush.

Now, what problem was this replacement meant to solve? The endl should've been doing its job well enough, no?

Metadata

Metadata

Assignees

No one assigned

    Labels

    subsystem: pluginsThe issue is related to plugins of planetarium...

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions