File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,6 @@ export class CoreEnforcer {
149
149
this . model . clearPolicy ( ) ;
150
150
await this . adapter . loadPolicy ( this . model ) ;
151
151
152
- this . model . printPolicy ( ) ;
153
152
if ( this . autoBuildRoleLinks ) {
154
153
await this . buildRoleLinksInternal ( ) ;
155
154
}
@@ -169,7 +168,6 @@ export class CoreEnforcer {
169
168
throw new Error ( 'filtered policies are not supported by this adapter' ) ;
170
169
}
171
170
172
- this . model . printPolicy ( ) ;
173
171
if ( this . autoBuildRoleLinks ) {
174
172
await this . buildRoleLinksInternal ( ) ;
175
173
}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import * as rbac from '../rbac';
16
16
import * as util from '../util' ;
17
17
import { Config , ConfigInterface } from '../config' ;
18
18
import { Assertion } from './assertion' ;
19
- import { logPrint } from '../log' ;
19
+ import { getLogger , logPrint } from '../log' ;
20
20
21
21
export const sectionNameMap : { [ index : string ] : string } = {
22
22
r : 'request_definition' ,
@@ -379,6 +379,9 @@ export class Model {
379
379
380
380
// printPolicy prints the policy to log.
381
381
public printPolicy ( ) : void {
382
+ if ( ! getLogger ( ) . isEnable ( ) ) {
383
+ return ;
384
+ }
382
385
logPrint ( 'Policy:' ) ;
383
386
this . model . forEach ( ( map , key ) => {
384
387
if ( key === 'p' || key === 'g' ) {
You can’t perform that action at this time.
0 commit comments