Skip to content

Commit

Permalink
Improve DebugLog
Browse files Browse the repository at this point in the history
  • Loading branch information
Bush2021 committed Oct 24, 2023
1 parent 7d9f3d3 commit 7a5e57b
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@ std::wstring Format(const wchar_t *format, ...)
return str;
}

void DebugLog(const wchar_t *format, ...)
{
// va_list args;
//
// va_start(args, format);
// auto str = Format(format, args);
// va_end(args);
//
// str = Format(L"[chrome++]%s\n", str.c_str());
//
// FILE *fp = nullptr;
// _wfopen_s(&fp, L"Chrome++_Debug.log", L"a+");
// if (fp)
// {
// fwrite(str.c_str(), str.size() * sizeof(wchar_t), 1, fp);
// fclose(fp);
// }
}

// 搜索内存
uint8_t *memmem(uint8_t *src, int n, const uint8_t *sub, int m)
{
Expand Down Expand Up @@ -104,6 +85,26 @@ std::wstring GetAppDir()
return path;
}

void DebugLog(const wchar_t *format, ...)
{
// va_list args;
//
// va_start(args, format);
// auto str = Format(format, args);
// va_end(args);
//
// str = Format(L"[chrome++]%s\n", str.c_str());
//
// FILE *fp = nullptr;
// std::wstring logPath = GetAppDir() + L"\\Chrome++_Debug.log";
// _wfopen_s(&fp, logPath.c_str(), L"a+");
// if (fp)
// {
// fwrite(str.c_str(), str.size() * sizeof(wchar_t), 1, fp);
// fclose(fp);
// }
}

// https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/chrome_command_ids.h?q=chrome_command_ids.h&ss=chromium%2Fchromium%2Fsrc
#define IDC_NEW_TAB 34014
#define IDC_CLOSE_TAB 34015
Expand Down

0 comments on commit 7a5e57b

Please sign in to comment.