summaryrefslogtreecommitdiff
path: root/Editor
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-01 12:10:29 +0800
committerchai <chaifix@163.com>2021-11-01 12:10:29 +0800
commit44d6c41e5e586572de08c72c358aed9100a30353 (patch)
treea3dee8cbb9f7181c88464b31f231a264c570acd4 /Editor
parent78417f6cdedfcf60c8ca437190975644e942e01f (diff)
*log
Diffstat (limited to 'Editor')
-rw-r--r--Editor/EditorMain.cpp4
-rw-r--r--Editor/GUI/ContainerWindow.cpp10
-rw-r--r--Editor/GUI/GUIWindow.cpp12
-rw-r--r--Editor/GUI/MenuManager.cpp6
-rw-r--r--Editor/Scripting/Editor/Editor.bind.cpp2
-rw-r--r--Editor/Scripting/EditorGUI/EditorGUI.bind.cpp2
-rw-r--r--Editor/Scripting/EditorScripting.cpp2
7 files changed, 20 insertions, 18 deletions
diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp
index 289eed4..45ac81a 100644
--- a/Editor/EditorMain.cpp
+++ b/Editor/EditorMain.cpp
@@ -15,7 +15,7 @@ using namespace LuaBind;
void ErrorHandle(cc8* msg)
{
- log_error(std::string("[Lua] ") + msg);
+ log_error("[Lua] %s", msg);
}
void TestFont()
@@ -68,6 +68,8 @@ int main()
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
#endif
{
+ log_info("log_info_c test, %s %d", "hello", 3);
+
WindowUtil::RegisterClasses();
LuaBind::VM vm;
diff --git a/Editor/GUI/ContainerWindow.cpp b/Editor/GUI/ContainerWindow.cpp
index 01bb1e9..d737838 100644
--- a/Editor/GUI/ContainerWindow.cpp
+++ b/Editor/GUI/ContainerWindow.cpp
@@ -24,7 +24,7 @@ LRESULT CALLBACK ContainerWindow::ContainerWndProc(HWND hWnd, UINT message, WPAR
return DefWindowProcW(hWnd, message, wParam, lParam);
}
- //log_info("WndProc", "ContainerWindow::ContainerWndProc(), ContainerWindow name is " + self->GetName());
+ //log_info_tag("WndProc", "ContainerWindow::ContainerWndProc(), ContainerWindow name is " + self->GetName());
switch (message)
{
@@ -412,16 +412,16 @@ void ContainerWindow::SetIcon(LPCSTR iconName)
HICON hWindowIcon = (HICON )LoadImage(winutils::GetInstanceHandle(), iconName, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_LOADFROMFILE);
if (hWindowIcon == NULL)
- log_error("icon error: " + to_string(GetLastError()));
+ log_error("icon error: %lu", GetLastError());
if (SendMessage(m_Window, WM_SETICON, ICON_BIG, (LPARAM)hWindowIcon) != WM_SETICON)
- log_error("icon error: " + to_string(GetLastError()));
+ log_error("icon error: %lu", GetLastError());
if (SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hWindowIcon) != WM_SETICON)
- log_error("icon error: " + to_string(GetLastError()));
+ log_error("icon error: %lu", GetLastError());
}
void ContainerWindow::Close()
{
- log_info("Close window " + m_Name);
+ log_info("Close window %s", m_Name);
SendMessage(m_Window, WM_CLOSE, 0, 0);
}
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp
index eb44647..011dfa8 100644
--- a/Editor/GUI/GUIWindow.cpp
+++ b/Editor/GUI/GUIWindow.cpp
@@ -34,7 +34,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
return DefWindowProcW(hWnd, message, wParam, lParam);
}
- //log_info("WndProc", "GUIWindow::GUIViewWndProc(), GUIWindow name is " + wnd->GetName());
+ //log_info_tag("WndProc", "GUIWindow::GUIViewWndProc(), GUIWindow name is %s", self->GetName());
switch (message)
{
@@ -44,7 +44,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_PAINT:
{
- log_info("WndProc", "WM_PAINT");
+ log_info_tag("WndProc", "WM_PAINT");
self->SetAsRenderContext();
self->OnPaint();
@@ -57,7 +57,7 @@ LRESULT CALLBACK GUIWindow::GUIViewWndProc(HWND hWnd, UINT message, WPARAM wPara
case WM_MOUSEWHEEL: // 在这个子窗口滚动
{
- log_info("WndProc","WM_MOUSEWHEEL");
+ log_info_tag("WndProc","WM_MOUSEWHEEL");
// quick check if mouse is in our window
RECT rc;
@@ -193,7 +193,7 @@ void GUIWindow::ProcessEventMessages(UINT message, WPARAM wParam, LPARAM lParam)
void GUIWindow::Init(std::string name)
{
- log_info("Init GUIWindow " /*+ (long)this*/);
+ log_info("Init GUIWindow");
m_Name = name;
@@ -237,7 +237,7 @@ void GUIWindow::Init(std::string name)
if (!bRC)
log_error("Failed to setup rendering context");
- log_info("Created GUIWindow " /*+ (long)this*/);
+ log_info("Created GUIWindow ");
}
bool GUIWindow::SetRenderContext()
@@ -338,7 +338,7 @@ void GUIWindow::SetAsRenderContext()
void GUIWindow::Focus()
{
- log_info("Focus GUIWindow " + (long)this);
+ log_info("Focus GUIWindow ");
if (m_Handle)
{
if (::GetForegroundWindow() != m_ContainerWindow->GetWindowHandle())
diff --git a/Editor/GUI/MenuManager.cpp b/Editor/GUI/MenuManager.cpp
index c0fc989..1ba35fd 100644
--- a/Editor/GUI/MenuManager.cpp
+++ b/Editor/GUI/MenuManager.cpp
@@ -45,17 +45,17 @@ void MenuManager::Init()
void MenuManager::AddMenuItem(std::string name, int order)
{
- log_info("Menu", " Add menu item \"" + name + "\"");
+ log_info_tag("Menu", " Add menu item \"%s\"", name);
}
void MenuManager::HandleMenuItemEvent(HMENU menu, unsigned int menuId, unsigned int flags)
{
- log_info("Menu", "menuId=" + to_string(menuId) + ", flags=" + to_string(flags));
+ log_info_tag("Menu", "menuId=%d, flags=%d",menuId, flags);
if (flags & MF_CHECKED) // clicked
{
- log_info("Menu", "checked");
+ log_info_tag("Menu", "checked");
}
} \ No newline at end of file
diff --git a/Editor/Scripting/Editor/Editor.bind.cpp b/Editor/Scripting/Editor/Editor.bind.cpp
index 9808141..99db0b2 100644
--- a/Editor/Scripting/Editor/Editor.bind.cpp
+++ b/Editor/Scripting/Editor/Editor.bind.cpp
@@ -3,7 +3,7 @@
// GameLab.Editor
int luaopen_GameLab_Editor(lua_State* L)
{
- log_info("Scripting", "luaopen_GameLab_Editor()");
+ log_info_tag("Scripting", "luaopen_GameLab_Editor()");
LUA_BIND_STATE(L);
diff --git a/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp b/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp
index 2fea6be..dc7b88c 100644
--- a/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp
+++ b/Editor/Scripting/EditorGUI/EditorGUI.bind.cpp
@@ -3,7 +3,7 @@
// GameLab.Editor.GUI
int luaopen_GameLab_Editor_GUI(lua_State* L)
{
- log_info("Scripting", "luaopen_GameLab_Editor_GUI()");
+ log_info_tag("Scripting", "luaopen_GameLab_Editor_GUI()");
LUA_BIND_STATE(L);
diff --git a/Editor/Scripting/EditorScripting.cpp b/Editor/Scripting/EditorScripting.cpp
index f384248..43ed666 100644
--- a/Editor/Scripting/EditorScripting.cpp
+++ b/Editor/Scripting/EditorScripting.cpp
@@ -34,7 +34,7 @@ extern int luaopen_GameLab_Editor_Scripting(lua_State* L); // GameLab.Editor.Scr
bool SetupGameLabEditorScripting(lua_State* L)
{
- log_info("Scripting", "SetupGameLabEditorScripting()");
+ log_info_tag("Scripting", "SetupGameLabEditorScripting()");
openlib(luaopen_GameLab);