diff options
-rw-r--r-- | .vscode/settings.json | 3 | ||||
-rw-r--r-- | main.lua | 2 | ||||
-rw-r--r-- | script/tracy.lua | 18 | ||||
-rw-r--r-- | test.lua | 1 |
4 files changed, 23 insertions, 1 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 89305242..54ad1616 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,7 +11,8 @@ "ID", "DEVELOP", "DBGPORT", - "DBGWAIT" + "DBGWAIT", + "tracy" ], "Lua.diagnostics.disable": [ "close-non-object" @@ -14,6 +14,8 @@ log.init(ROOT, ROOT / 'log' / 'service.log') log.info('Lua Lsp startup, root: ', ROOT) log.debug('ROOT:', ROOT:string()) +require 'tracy' .disable() + xpcall(dofile, log.debug, rootPath .. '/debugger.lua') local service = require 'service' diff --git a/script/tracy.lua b/script/tracy.lua new file mode 100644 index 00000000..a5f6d9b1 --- /dev/null +++ b/script/tracy.lua @@ -0,0 +1,18 @@ +local suc = pcall(require, 'luatracy') +local originTracy = tracy + +local function enable() + tracy = originTracy +end + +local function disable() + tracy = { + ZoneBeginN = function () end, + ZoneEnd = function () end, + } +end + +return { + enable = enable, + disable = disable, +} @@ -18,6 +18,7 @@ log.debug('测试开始') ac = {} --dofile((ROOT / 'build_package.lua'):string()) +require 'tracy' .enable() local function loadAllLibs() assert(require 'bee.filesystem') |