Skip to content

Conversation

@GrantComm
Copy link
Collaborator

Writes application logs to text file. Writing to console is now toggleable.

static void Initialize(const char *argv0)
{
QString filename = "dive-" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmss") +
QString filename = "dive-crash" + QDateTime::currentDateTime().toString("yyyyMMdd-HHmmss") +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crash handler should output to the logfile, having them separate makes gathering information harder

// Write to file using the resolved path
QFile logFile(m_resolved_path);

if (logFile.open(QIODevice::WriteOnly | QIODevice::Append))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want a file that is opened for the entire lifetime of the application.

@hysw
Copy link
Collaborator

hysw commented Dec 9, 2025

Consider using absl::log. i.e.

ABSL_LOG(LEVEL(level)).AtLocation(file, line) << msg;

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

Successfully merging this pull request may close these issues.

2 participants