1 /*
2    mkvpropedit -- utility for editing properties of existing Matroska files
3 
4    Distributed under the GPL v2
5    see the file COPYING for details
6    or visit https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
7 
8    Written by Moritz Bunkus <moritz@bunkus.org>.
9 */
10 
11 #include "common/common_pch.h"
12 
13 #include <windows.h>
14 
15 #include "common/logger/windows.h"
16 
17 namespace mtx::log {
18 
windows_debug_target_c()19 windows_debug_target_c::windows_debug_target_c()
20   : target_c{}
21 {
22 }
23 
~windows_debug_target_c()24 windows_debug_target_c::~windows_debug_target_c() {
25 }
26 
27 void
log_line(std::string const & message)28 windows_debug_target_c::log_line(std::string const &message) {
29   auto line = to_wide(fmt::format("[mtx] +{0}ms {1}", runtime(), message));
30   OutputDebugStringW(line.c_str());
31 }
32 
33 void
activate()34 windows_debug_target_c::activate() {
35   s_default_logger = std::static_pointer_cast<target_c>(std::make_shared<windows_debug_target_c>());
36 }
37 
38 }
39