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

Enable console logging if MONO or LOGGER is defined #159

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

jcoby
Copy link
Contributor

@jcoby jcoby commented Apr 23, 2024

Re-enable console logging on linux and mac builds with the -DMONO option.

Rename overloaded Debug_ConsolePrintf function to
Debug_ConsolePrintfAt to fix macro expansion.

Adds -DLOGGER alias for -DMONO.

Implements #157

@jcoby jcoby mentioned this pull request Apr 23, 2024
@jcoby jcoby force-pushed the enable-console-logging branch from 67ed7dc to 34afd85 Compare April 23, 2024 12:51
Re-enable console logging on linux and mac builds with the -DMONO
option.

Rename overloaded Debug_ConsolePrintf function to
Debug_ConsolePrintfAt to fix macro expansion.

Adds -DLOGGER alias for -DMONO.

Implements DescentDevelopers#157
@jcoby jcoby force-pushed the enable-console-logging branch from 34afd85 to 9753f83 Compare April 23, 2024 13:07
CMakeLists.txt Outdated
set(PLATFORM_INCLUDES "lib/linux" ${SDL_INCLUDE_DIR})
endif()

if(APPLE)
message("Building for MAC OSX")
add_definitions(-D_DEBUG -D__LINUX__ -DLINUX -D_MAX_PATH=260 -D_MAX_FNAME=256 -D_REENRANT -DMACOSX=1 -D_USE_OGL_ACTIVE_TEXTURES)
add_definitions(-D_DEBUG -D__LINUX__ -DLINUX -D_MAX_PATH=260 -D_MAX_FNAME=256 -D_REENRANT -DMACOSX=1 -D_USE_OGL_ACTIVE_TEXTURES -DLOGGER)
Copy link
Member

Choose a reason for hiding this comment

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

we want this definition conditionally, if the user specified the CMake Option LOGGER

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in latest commit

lib/mono.h Outdated
@@ -66,12 +66,12 @@
#include "debug.h"
void nw_InitTCPLogging(char *ip, unsigned short port);
void nw_TCPPrintf(int n, char *format, ...);
#if (!defined(RELEASE)) && defined(MONO)
#if (!defined(RELEASE)) && (defined(MONO) || defined(LOGGER))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to keep both, LOGGER is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to keep both so we could keep the MONO code for historical reasons if we add a logging library. But it's easy enough to resurrect MONO later.

 * Adds CMake Option
 * Adds LOGGER to the README
 * Removes MONO define in favor of LOGGER
@Lgt2x
Copy link
Member

Lgt2x commented Apr 23, 2024

Tested, works great. Thanks!

@Lgt2x Lgt2x merged commit 959a453 into DescentDevelopers:main Apr 23, 2024
5 checks passed
@JeodC JeodC linked an issue Apr 24, 2024 that may be closed by this pull request
JeodC pushed a commit that referenced this pull request Apr 28, 2024
Enable console logging if MONO or LOGGER is defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable console logging
2 participants