Skip to content

Commit

Permalink
Fix DisableLoggingFeature for JBoss Threads/Hibernate/Infinispan/Webs…
Browse files Browse the repository at this point in the history
…ocket-client

The log level we get in beforeAnalysis may be null, in which case we
still want to reset it after analysis.

From the javadoc of Logger#getLevel:

> Get the log Level that has been specified for this Logger.
> The result may be null, which means that this logger's effective level will be inherited from its parent.
  • Loading branch information
yrodiere committed May 3, 2024
1 parent 4eaa586 commit 554ae55
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public void beforeAnalysis(BeforeAnalysisAccess access) {
public void afterAnalysis(AfterAnalysisAccess access) {
for (String category : CATEGORIES) {
Level level = categoryMap.remove(category);
if (level != null) {
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
Logger logger = Logger.getLogger(category);
logger.setLevel(level);
}
}

Expand Down

0 comments on commit 554ae55

Please sign in to comment.