Skip to content

Commit

Permalink
[core] rework /x4d slash commands -debug->debug,-test->dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wilson0x4d committed Sep 10, 2019
1 parent 974cadd commit 60b655c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -65,14 +65,14 @@ There are slash commands you will find useful when debugging AddOns or Testing c

| Command | |
|-|-|
| `/x4d -test` | Sets the log level to VERBOSE (shows 'useful' logging/activity, but not 'all'), and then performs a broad test of X4D_Core module. If you're doing any development that uses X4D_Core you will usually use this command after performing a `/reloadui`. |
| `/x4d -debug` | Sets the log level to DEBUG (shows all logging/activity), and adds a performance summary in the Chat window. You will not use this command often/ever. |
| `/x4d pos` | Print player location including both map coordinates and normalized coordinations. |
| `/x4d` | Without arguments this slash-command will print Version Info. |
| `/x4d` | Without arguments this slash-command will print a 'Version' and 'Load Time' summary for all X4D AddOns. |
| `/x4d dev` | Puts the AddOns into 'Developer Mode'; Sets the log level to VERBOSE (shows 'useful' logging/activity, but not 'all'), and then performs a broad test of X4D_Core module. If you're doing any development that uses X4D_Core you will usually use this command after performing a `/reloadui`. |
| `/x4d debug` | Puts the AddOns into 'Debugger Mode'; Sets the log level to DEBUG (shows all logging/activity), and adds a performance summary in the Chat window. You will not use this command often/ever. |
| `/x4d pos`,`/x4d loc` | Print player location including 'normalized/virtual' and 'minimap/actual' coordinates. |

Additionally, the `X4D_DB` module exposes its own commands:

| Command | Args | |
| Command | |
|-|-|
| `/x4db count [DBNAME]` | Writes the count for the specified database. If no database is specified then "all" DBs are enumerated. Please be aware that 'transient' databases may be enumerated by this command. |
| `/x4db reset <DBNAME>` | Resets the target database such that it contains no items, no keys. Nothing. WARNING! Performing this against a "Core" DB may have unintended side-effects that will require you to manually delete savedvars. You should only use this to reset your OWN databases. |
Expand Down
5 changes: 3 additions & 2 deletions X4D_Core/X4D_Core.lua
Expand Up @@ -281,12 +281,13 @@ SLASH_COMMANDS["/x4d"] = function (parameters, other)
if (parameters ~= nil and parameters:len() > 0) then
X4D.Log:Information("Parameters: " .. parameters, "X4D")
end
if (parameters == "-debug") then
if (parameters == "debug") then
X4D.Log:SetTraceLevel(X4D.Log.TRACE_LEVELS.DEBUG)
if (Zgoo ~= nil) then
Zgoo:Main(nil,1,X4D)
end
elseif (parameters == "-test") then
elseif (parameters == "dev") then
X4D.Log:SetTraceLevel(X4D.Log.TRACE_LEVELS.VERBOSE)
X4D.Test()
return
elseif (parameters:StartsWith("backpack ")) then
Expand Down

0 comments on commit 60b655c

Please sign in to comment.