Skip to content

feat: Allow passing enableLog flag when creating SyncedEnforcer with adapter#510

Merged
hsluoyz merged 5 commits intocasbin:masterfrom
TheSecondReal0:synced-logging-flag
Feb 12, 2026
Merged

feat: Allow passing enableLog flag when creating SyncedEnforcer with adapter#510
hsluoyz merged 5 commits intocasbin:masterfrom
TheSecondReal0:synced-logging-flag

Conversation

@TheSecondReal0
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commented Feb 11, 2026

CLA assistant check
All committers have signed the CLA.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds constructor overloads to allow callers to control Casbin logging (enableLog) when creating Enforcer/SyncedEnforcer instances using an Adapter, aligning adapter-based construction with existing policy-file-based constructors.

Changes:

  • Add Enforcer(String modelPath, Adapter adapter, boolean enableLog) and route the existing (String, Adapter) constructor through it.
  • Add matching SyncedEnforcer overloads for (String, Adapter, boolean) and (Model, Adapter, boolean) that delegate to Enforcer.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/java/org/casbin/jcasbin/main/SyncedEnforcer.java Adds new enableLog-aware constructors for adapter-based initialization.
src/main/java/org/casbin/jcasbin/main/Enforcer.java Introduces a new adapter constructor overload that accepts enableLog and updates the existing constructor to delegate to it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hsluoyz hsluoyz merged commit c617f4d into casbin:master Feb 12, 2026
9 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.97.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants

Comments