Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "messagereceiver.h"
#include "utils.h"
#include <QDebug>
#include <QStandardPaths>

#ifdef _WIN32
#include <Windows.h>
Expand Down Expand Up @@ -169,7 +170,15 @@ int main(int argc, char *argv[])
app.setApplicationName("DFTFringe");

auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
auto file_sink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>("DFTFringeLogs/log.txt", 1048576 * 5, 3);

#ifdef Q_OS_MAC
const std::string logFile = (QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
+ "/DFTFringeLogs/log.txt").toStdString();
#else
const std::string logFile = "DFTFringeLogs/log.txt";
#endif

auto file_sink = std::make_shared<spdlog::sinks::rotating_file_sink_mt>(logFile, 1048576 * 5, 3);

auto combined_logger = std::make_shared<spdlog::logger>("logger", spdlog::sinks_init_list({console_sink, file_sink}));

Expand Down
Loading