Skip to content

Conversation

@bburns632
Copy link
Collaborator

🎯 Summary

Removes the futile.logger dependency and updates igraph compatibility to version 2.1+, improving package maintainability and aligning with modern igraph API.


🔧 Changes

📝 Logging System Refactor

Replaced futile.logger with custom SimpleLogger class

  • ✅ Lightweight R6-based logging using only base R
  • ✅ Maintains threshold-based logging (INFO/WARN/FATAL levels)
  • ✅ Reduces external dependencies and compatibility issues
  • ✅ Updated all logging calls throughout codebase

Files modified:

  • R/logging.R - New SimpleLogger R6 class implementation
  • tests/testthat/setup-logger.R - Updated test configuration
  • tests/testthat/teardown-logger.R - Updated teardown logic

📊 igraph Compatibility Update

Bumped minimum version: >= 1.3 → >= 2.1

Old Function New Function Purpose
graph.edgelist() graph_from_edgelist() Graph construction
neighborhood.size() ego_size() Neighborhood calculations
hub_score() / authority_score() hits_scores() Hub/authority scores (unified API)

Updated files:

  • R/GraphClasses.R
  • R/AbstractGraphReporter.R
  • man/DirectedGraphMeasures.Rd

🧪 Testing Improvements

  • ❌ Removed static CSV test fixtures for graph measures
  • ✅ Tests now validate structure/behavior vs exact values
  • ✅ Improved maintainability across igraph versions
  • ✅ Fixed GitHub Actions smoke test configuration

📚 Documentation


⚠️ Breaking Changes

None - Internal implementation changes only. Public API remains unchanged.


✅ Testing

All checks passing:

  • Full test suite passes with new logging system
  • igraph 2.1 compatibility verified
  • No futile.logger dependency required
  • GitHub Actions workflows pass

📦 Dependencies

Removed:

  • futile.logger

Updated:

  • igraph (>= 1.3)
  • igraph (>= 2.1)

🔗 Related Issues

Fixes #338

@bburns632 bburns632 merged commit ec45c46 into main Jan 27, 2026
6 checks passed
@bburns632 bburns632 deleted the loggingUpdate branch January 27, 2026 02:48
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

I'd been working on reviewing this but just saw you merged it. Do what you want with the feedback, thanks for working on this.

testObj$edges
})
#expect_silent({testObj$nodes})
#expect_silent({testObj$edges})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are all these tests getting commented out?

If they're not needed any more, they should be removed. If they're needed but just not working right now, we should leave an explanatory comment (and ideally issue link(s)) explaining what would be needed to re-eanble them.

#'
#' @keywords internal
#' @importFrom R6 R6Class
SimpleLogger <- R6::R6Class(
Copy link
Collaborator

Choose a reason for hiding this comment

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

In my opinion, this complexity isn't worth it for lightly-used, completely internal functionality.

With {futile.logger}, it's technically possible for users to change the log verbosity by running futile.logger::flog.threshold() in their session.

As of this PR, the only way to influence {pkgnet}'s log verbosity would be to reach into private methods. I think basically no one will do that, and if they do we'll probably discourage it.

Would you consider just instead doing something like uptake/uptasticsearch#260, completely eliminating the idea of setting thresholds?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That'd also allow us to to eliminate PKGNET_TEST_ORIG_LOG_THRESHOLD and everything else related to setting and unsetting log thresholds in tests. Could be a pretty nice simplification.

# CRAN Submission History

## v 0.5.0
## v 0.5.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
## v 0.5.0
## v 0.5.0

This looks like it was a mistake.

)
)
})
#expect_silent({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question why are we just commenting this out?

@bburns632
Copy link
Collaborator Author

As always, thanks for the review. I'm moving fairly quickly to maintain CRAN hosting deadline (EOM) and doing this in the margins of the day.

The commented out tests are gross. Yes indeed. I packaged them under one commit so they are easily reverted later. Guess I could just as easily deleted them with that commit packaging.

For the life of me, I can't figure out why those functions where expected to be silent, and what behavior changed recently. I punted and removed them, planning to make a bug ticket to add em back in after CRAN update BUT everything appears fine without 'em. I'll remove the commented out code in a dev version to follow.

Re logging object, that was claude's addition. I let it ride.

@jameslamb
Copy link
Collaborator

Yep all good man! Do what you need to, this is all internal-to-the-package stuff that users won't ever see.

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.

3 participants