-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable Jetty debug in Maven verbose mode
Jetty produces many debug logs, it can make mess in verbose mode. Disabled by default, can be enabled by debugServer parameter.
- Loading branch information
1 parent
7e2a2e5
commit 4cd5a33
Showing
3 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
mrm-maven-plugin/src/main/java/org/codehaus/mojo/mrm/plugin/ServerLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package org.codehaus.mojo.mrm.plugin; | ||
|
||
/* | ||
* Copyright MojoHaus and Contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
import org.eclipse.jetty.util.log.Logger; | ||
import org.eclipse.jetty.util.log.Slf4jLog; | ||
|
||
/** | ||
* Jetty SLF4J logger with debug level configuration. | ||
* | ||
* @author Slawomir Jaranowski | ||
*/ | ||
class ServerLogger extends Slf4jLog | ||
{ | ||
private final boolean debugEnabled; | ||
|
||
public ServerLogger( boolean debugEnabled ) | ||
{ | ||
this( ServerLogger.class.getName(), debugEnabled ); | ||
} | ||
|
||
public ServerLogger( String name, boolean debugEnabled ) | ||
{ | ||
super( name ); | ||
this.debugEnabled = debugEnabled; | ||
} | ||
|
||
@Override | ||
public void debug( String msg, Object... args ) | ||
{ | ||
if ( isDebugEnabled() ) | ||
{ | ||
super.debug( msg, args ); | ||
} | ||
} | ||
|
||
@Override | ||
public void debug( String msg, long arg ) | ||
{ | ||
if ( isDebugEnabled() ) | ||
{ | ||
super.debug( msg, arg ); | ||
} | ||
} | ||
|
||
@Override | ||
public void debug( Throwable thrown ) | ||
{ | ||
if ( isDebugEnabled() ) | ||
{ | ||
super.debug( thrown ); | ||
} | ||
} | ||
|
||
@Override | ||
public void debug( String msg, Throwable thrown ) | ||
{ | ||
if ( isDebugEnabled() ) | ||
{ | ||
super.debug( msg, thrown ); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isDebugEnabled() | ||
{ | ||
return debugEnabled; | ||
} | ||
|
||
@Override | ||
public void setDebugEnabled( boolean enabled ) | ||
{ | ||
// do nothing | ||
} | ||
|
||
@Override | ||
protected Logger newLogger( String fullname ) | ||
{ | ||
return new ServerLogger( fullname, debugEnabled ); | ||
} | ||
} |