MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / dsv_log_enalbe_logfile

Function dsv_log_enalbe_logfile

DSView/pv/log.cpp:61–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void dsv_log_enalbe_logfile(bool append)
62{
63 if (!b_logfile && log_ctx){
64 b_logfile = true;
65
66 QString lf = get_dsv_log_path();
67
68 dsv_info("%s\"%s\"", "Store log to file: ", lf.toUtf8().data());
69
70 QFileInfo fileInfo(lf);
71 QString file_dir = fileInfo.absolutePath();
72
73 QDir dir;
74 if (!dir.exists(file_dir) && !dir.mkpath(file_dir)){
75 dsv_err("ERROR: failed to create log directory.");
76 }
77
78 std::string log_file = pv::path::ToUnicodePath(lf);
79
80 int ret = xlog_add_receiver_from_file(log_ctx, log_file.c_str(), &log_file_index, append);
81 if (ret != 0){
82 dsv_err("Create log file error!");
83 }
84 }
85}
86
87void dsv_clear_log_file()
88{

Callers 2

mainFunction · 0.85
on_action_setting_logMethod · 0.85

Calls 4

get_dsv_log_pathFunction · 0.85
ToUnicodePathFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected