Skip to content

Remove Log4cplus - #2353

Merged
danrbailey merged 8 commits into
masterfrom
feature/remove_log4cplus
Oct 24, 2026
Merged

danrbailey merged 8 commits into
masterfrom
feature/remove_log4cplus

Conversation

@danrbailey

Copy link
Copy Markdown
Contributor

This came out of a few conversations and raised issues. Our logging is complicated. We use an optional third-party library (https://github.com/log4cplus/log4cplus) which provides lots of functionality, 98% of which we don't use. Most studios do not switch this extra logging on (I have never personally used it) and it is not tested in our CI infrastructure at all. The CMake code in particular is clunky and complicated.

However... it still provides some value, particularly for Houdini. We have lots of macros such as OPENVDB_LOG_ERROR that are used throughout the codebase. When Log4cplus is not enabled, it simply routes all the errors, logs, warnings, etc to stderr.

In this change, I have removed support for Log4cplus entirely and replaced it with a simple alternative that does everything we currently use Log4cplus which is to collect log data and propagate it.

Here's a simple example, this is what happens if you connect up a VDB Project Non-Divergent SOP with an empty velocity field, you get this output in the shell in which you launched Houdini. It is buried and often not seen by the user:

WARNING: pcg::solve(): matrix has dimension zero

The node itself displays this:
doodler_upcxnag4

With this alternative logging implementation hooked up, you now get this:
doodler__ixbo5z6

In summary, in addition to the warning being output to the shell, it is also propagated to Houdini's UT_ErrorManager so that it is output on the node as well.

Houdini is the main use case, but this also affects binaries. There is now a flag on each of the binaries to set the logging diagnostic level (vdb_print -error for example).

@jmlait @Idclip

@danrbailey
danrbailey force-pushed the feature/remove_log4cplus branch 2 times, most recently from 98fb42c to da9b9dd Compare October 13, 2026 16:43
@danrbailey
danrbailey changed the base branch from master to feature/remove_blosc October 13, 2026 16:43
@danrbailey
danrbailey added this pull request to stack #2364 October 13, 2026 16:43

@jmlait jmlait left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the default is currently not to compile log4, so this change will effectively engage the warning logs in Houdini.

Those use the HoudniSink, which will send them to the current error manager. This can be troublesome as that isn't always the proper target - historically we've got a lot of errors sent to "/" and other nodes. We also have an issue that it is taking ERROR/FATAL and adding them as ABORT/FATAL. This becomes a significant behaviour change when logging is enabled - things will go from a cerr output to a red-flag on a node and stop the processing. If the logger intended a true ERROR/FATAL they need to raise an exception or otherwise return, not expect the logging path itself to terminate execution...

So I think the HoudniSink should downgrade error/fatal to warnings, with the assumption there will be an exception actually red-flag the node. (It is also less harmful with sending warnings to the wrong node - sending errors to the wrong node can break cooking)

The right thing is probably to have the HoudiniSink tie to the https://www.sidefx.com/docs/hdk/class_u_t___universal_log_source.html but I also don't think the perfect has to be the enemy of the good, as we want to remove log4fcplus as well.

My suggestion is thus to just downgrade the errors (with an explanation of why they can't be past at the same error level) and disable the HoudiniSink by default, having people opt into hte HoudiniSink like they did before. That way we can get rid of log4cplus and figure out the proper HoudiniSink as a separate pass.

@danrbailey
danrbailey force-pushed the feature/remove_blosc branch from 6ba87bd to 1cdc288 Compare October 14, 2026 23:41
@danrbailey

Copy link
Copy Markdown
Contributor Author

I think the default is currently not to compile log4, so this change will effectively engage the warning logs in Houdini.

Those use the HoudniSink, which will send them to the current error manager. This can be troublesome as that isn't always the proper target - historically we've got a lot of errors sent to "/" and other nodes. We also have an issue that it is taking ERROR/FATAL and adding them as ABORT/FATAL. This becomes a significant behaviour change when logging is enabled - things will go from a cerr output to a red-flag on a node and stop the processing. If the logger intended a true ERROR/FATAL they need to raise an exception or otherwise return, not expect the logging path itself to terminate execution...

So I think the HoudniSink should downgrade error/fatal to warnings, with the assumption there will be an exception actually red-flag the node. (It is also less harmful with sending warnings to the wrong node - sending errors to the wrong node can break cooking)

The right thing is probably to have the HoudiniSink tie to the https://www.sidefx.com/docs/hdk/class_u_t___universal_log_source.html but I also don't think the perfect has to be the enemy of the good, as we want to remove log4fcplus as well.

My suggestion is thus to just downgrade the errors (with an explanation of why they can't be past at the same error level) and disable the HoudiniSink by default, having people opt into hte HoudiniSink like they did before. That way we can get rid of log4cplus and figure out the proper HoudiniSink as a separate pass.

Thanks for the feedback. I've added OPENVDB_HOUDINI_LOG_FORWARDING in the CMake which defaults to OFF now. I made the changes you suggested to use the UniversalLogSource and it seems to work ok. I can see "OpenVDB" entries showing up in the Log Viewer as intended. I also downgraded ERROR/FATAL as you suggested.

@danrbailey
danrbailey force-pushed the feature/remove_blosc branch from 1cdc288 to 91819b5 Compare October 21, 2026 05:52
@danrbailey
danrbailey force-pushed the feature/remove_log4cplus branch from 13f1701 to 9a1f180 Compare October 21, 2026 05:54
@jmlait
jmlait self-requested a review October 21, 2026 20:51
@danrbailey
danrbailey removed this pull request from stack #2364 October 24, 2026 04:29
Signed-off-by: Dan Bailey <danbailey@ilm.com>
Signed-off-by: Dan Bailey <danbailey@ilm.com>
Signed-off-by: Dan Bailey <danbailey@ilm.com>
Signed-off-by: Dan Bailey <danbailey@ilm.com>
Signed-off-by: Dan Bailey <danbailey@ilm.com>
Signed-off-by: Dan Bailey <danbailey@ilm.com>
@danrbailey
danrbailey force-pushed the feature/remove_log4cplus branch from 9a1f180 to f1235a8 Compare October 24, 2026 04:56
@danrbailey
danrbailey changed the base branch from feature/remove_blosc to master October 24, 2026 04:56
Signed-off-by: Dan Bailey <danbailey@ilm.com>
Signed-off-by: Dan Bailey <danbailey@ilm.com>
@danrbailey
danrbailey merged commit 2ad7243 into master Oct 24, 2026
79 checks passed
@danrbailey
danrbailey deleted the feature/remove_log4cplus branch October 24, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants