Inkscape
Vector Graphics Editor
framecheck.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#include <fstream>
3#include <iostream>
4#include <mutex>
5#include <boost/filesystem.hpp> // Using boost::filesystem instead of std::filesystem due to broken C++17 on MacOS.
6#include "framecheck.h"
7namespace fs = boost::filesystem;
8
10
12{
13 static std::mutex mutex;
14 static auto logfile = [] {
15 auto path = fs::temp_directory_path() / "framecheck.txt";
16 auto mode = std::ios_base::out | std::ios_base::app | std::ios_base::binary;
17 return std::ofstream(path.string(), mode);
18 }();
19
20 auto lock = std::lock_guard(mutex);
21 logfile << name << ' ' << start << ' ' << g_get_monotonic_time() << ' ' << subtype << std::endl;
22}
23
24} // namespace Inkscape::FrameCheck
std::mutex mutex
Definition: canvas.cpp:177
int mode
Definition: parametrics.cpp:20