Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1158: add outputDebugString level 4 to omit debug info #1167

Merged

Conversation

Addlibs
Copy link
Contributor

@Addlibs Addlibs commented Nov 25, 2019

This pull adds a new parameter to outputDebugString for omitting file path and line number info from a custom debug message. This pull closes #1158

@Citizen01 Citizen01 added the enhancement New feature or request label Nov 26, 2019
…d redundant call to ComposeErrorMessage when unnecessary
…ly happen if message level is 0 just like on the server-side
@Addlibs Addlibs force-pushed the feature/outputdebugstring-extras branch from 7d09d3a to 7d8ca27 Compare November 26, 2019 15:15
@qaisjp
Copy link
Contributor

qaisjp commented Mar 23, 2020

If this is only available for level 0, why not just add a level 4 with this behaviour? (This would rename 0 from custom to debug. And make 4 the new "custom".)

Alternatively, we could keep your feature behind an extra boolean, but also make it work for any level.

What do you think?

@qaisjp qaisjp changed the title Implements #1158: Added bool to omit debug info from outputDebugString type 0 (custom) Fix #1158: Add bool to omit debug info from outputDebugString level 0 (custom) Mar 23, 2020
@qaisjp qaisjp modified the milestones: Backlog, 1.6 Mar 23, 2020
@Addlibs
Copy link
Contributor Author

Addlibs commented Mar 23, 2020

I do like the idea of moving it to its own type/level. Much cleaner solution than an additional bool I guess.

Copy link
Contributor

@qaisjp qaisjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for new level

@@ -55,6 +55,21 @@ void CScriptDebugging::LogCustom(lua_State* luaVM, unsigned char ucRed, unsigned
VSNPRINTF(szBuffer, MAX_STRING_LENGTH, szFormat, marker);
va_end(marker);

SLuaDebugInfo luaDebugInfo;
LogString("", luaDebugInfo, szBuffer, 0, ucRed, ucGreen, ucBlue);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new LogCustom still uses 0 as the uiMinimumDebugLevel so that we don't have to add a 4th level to /debugscript and instead simply show them in the same level as previous custom-level messages. The differenciation between LogCustom and LogDebug is based on whether DEBUG_INFO_NONE of SLuaDebugInfo is used instead of real debug info.

@qaisjp qaisjp changed the title Fix #1158: Add bool to omit debug info from outputDebugString level 0 (custom) Fix #1158: add outputDebugString level 4 to omit debug info Apr 1, 2020
@qaisjp qaisjp merged commit 865f4fd into multitheftauto:master Apr 1, 2020
@qaisjp
Copy link
Contributor

qaisjp commented Apr 1, 2020

Thank you!

Copy link
Contributor

@qaisjp qaisjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, I hoped this would get rid of the "Changes requested" message

@Addlibs Addlibs deleted the feature/outputdebugstring-extras branch April 2, 2020 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjustment for outputDebugString - level 0
4 participants