Page 1 of 1
log console to file?
Posted: Thu Jan 17, 2019 11:28 am
by ashenkin
Hi there,
Is there any way to set up CC to log the console output to a file? This is especially important in case CC crashes and i've done work i don't want to lose (in my case, recording transformation matrices is important). Yes, I can copy and paste manually, but if i forget sometimes, etc...
thanks,
allie
Re: log console to file?
Posted: Thu Jan 17, 2019 8:59 pm
by daniel
There's only the '-LOG_FILE' option, would it work for you? (
http://www.cloudcompare.org/doc/wiki/in ... _line_mode)
(and if CC crashes, just tell us ;)
Re: log console to file?
Posted: Wed Jan 23, 2019 10:33 am
by ashenkin
Thanks Daniel - any way to run the full GUI with the logfile option turned on? cloudcompare -LOG_FILE "temp.txt" just runs the cli and then closes...
Re: log console to file?
Posted: Wed Jan 23, 2019 7:23 pm
by daniel
Oh sorry I misunderstood. Then no, this option is not available with the GUI version.
Re: log console to file?
Posted: Thu Jan 24, 2019 2:18 pm
by ashenkin
ok, thanks daniel.
Re: log console to file?
Posted: Mon Sep 18, 2023 9:31 am
by mdf_anas
In mainwindow.cpp MainWindow::MainWindow(),add follow code.
Code: Select all
//Console
ccConsole::Init(m_UI->consoleWidget, this, this);
m_UI->actionEnableQtWarnings->setChecked(ccConsole::QtMessagesEnabled());
QString applicationPath = QApplication::applicationDirPath();
QString logDirPath = applicationPath + "/logs/";
QDir logPathDir(logDirPath);
if (!logPathDir.exists())
{
logPathDir.mkpath(logDirPath);
}
QString currentDateTime = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss");
QString logPath = logDirPath + currentDateTime + ".log";
ccConsole* consoleObj = ccConsole::TheInstance(false);
consoleObj->setLogFile(logPath);