Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uppercase LOG class constant. #204

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public final class WikiEventManager {

private static final Logger log = LogManager.getLogger(WikiEventManager.class);
private static final Logger LOG = LogManager.getLogger(WikiEventManager.class);

/* If true, permits a WikiEventMonitor to be set. */
private static final boolean c_permitMonitor = false;
Expand All @@ -144,7 +144,7 @@ public final class WikiEventManager {
/** Constructor for a WikiEventManager. */
private WikiEventManager() {
c_instance = this;
log.debug( "instantiated WikiEventManager" );
LOG.debug( "instantiated WikiEventManager" );
}

/**
Expand Down Expand Up @@ -475,7 +475,7 @@ public void fireEvent( final WikiEvent event ) {
}
} catch( final ConcurrentModificationException e ) {
// We don't die, we just don't do notifications in that case.
log.info( "Concurrent modification of event list; please report this.", e );
LOG.info( "Concurrent modification of event list; please report this.", e );
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions jspwiki-main/src/main/java/org/apache/wiki/WatchDog.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public final class WatchDog {
private boolean m_enabled = true;
private final Engine m_engine;

private static final Logger log = LogManager.getLogger( WatchDog.class );
private static final Logger LOG = LogManager.getLogger( WatchDog.class );

private static final Map< Integer, WeakReference< WatchDog > > c_kennel = new ConcurrentHashMap<>();
private static WikiBackgroundThread c_watcherThread;
Expand Down Expand Up @@ -185,7 +185,7 @@ public void enterState( final String state ) {
* @param expectedCompletionTime The timeout in seconds.
*/
public void enterState( final String state, final int expectedCompletionTime ) {
log.debug( "{}: Entering state {}, expected completion in {} s", m_watchable.getName(), state, expectedCompletionTime );
LOG.debug( "{}: Entering state {}, expected completion in {} s", m_watchable.getName(), state, expectedCompletionTime );
synchronized( m_stateStack ) {
final State st = new State( state, expectedCompletionTime );
m_stateStack.push( st );
Expand Down Expand Up @@ -213,14 +213,14 @@ public void exitState( final String state ) {
if( state == null || st.getState().equals( state ) ) {
m_stateStack.pop();

log.debug( "{}: Exiting state {}", m_watchable.getName(), st.getState() );
LOG.debug( "{}: Exiting state {}", m_watchable.getName(), st.getState() );
} else {
// FIXME: should actually go and fix things for that
log.error( "exitState() called before enterState()" );
LOG.error( "exitState() called before enterState()" );
}
}
} else {
log.warn( "Stack for " + m_watchable.getName() + " is empty!" );
LOG.warn( "Stack for " + m_watchable.getName() + " is empty!" );
}
}

Expand All @@ -243,23 +243,23 @@ public boolean isWatchableAlive() {
}

private void check() {
log.debug( "Checking watchdog '{}'", m_watchable.getName() );
LOG.debug( "Checking watchdog '{}'", m_watchable.getName() );

synchronized( m_stateStack ) {
if( !m_stateStack.empty() ) {
final State st = m_stateStack.peek();
final long now = System.currentTimeMillis();

if( now > st.getExpiryTime() ) {
log.info( "Watchable '" + m_watchable.getName() + "' exceeded timeout in state '" + st.getState() +
LOG.info( "Watchable '" + m_watchable.getName() + "' exceeded timeout in state '" + st.getState() +
"' by " + (now - st.getExpiryTime()) / 1000 + " seconds" +
( log.isDebugEnabled() ? "" : "Enable DEBUG-level logging to see stack traces." ) );
( LOG.isDebugEnabled() ? "" : "Enable DEBUG-level logging to see stack traces." ) );
dumpStackTraceForWatchable();

m_watchable.timeoutExceeded( st.getState() );
}
} else {
log.warn( "Stack for " + m_watchable.getName() + " is empty!" );
LOG.warn( "Stack for " + m_watchable.getName() + " is empty!" );
}
}
}
Expand All @@ -268,7 +268,7 @@ private void check() {
* Dumps the stack traces as DEBUG level events.
*/
private void dumpStackTraceForWatchable() {
if( !log.isDebugEnabled() ) {
if( !LOG.isDebugEnabled() ) {
return;
}

Expand All @@ -292,7 +292,7 @@ private void dumpStackTraceForWatchable() {
}
}

log.debug( stacktrace.toString() );
LOG.debug( stacktrace.toString() );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public final void run() {
// Perform the background task; check every second for thread death
while( !m_killMe ) {
// Perform the background task
// log.debug( "Running background task: " + name + "." );
// LOG.debug( "Running background task: " + name + "." );
backgroundTask();

// Sleep for the interval we're supposed to, but wake up every POLLING_INTERVAL to see if thread should die
Expand Down
4 changes: 2 additions & 2 deletions jspwiki-main/src/main/java/org/apache/wiki/WikiContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class WikiContext implements Context, Command {
/** User wants to view or administer workflows. */
public static final String WORKFLOW = ContextEnum.WIKI_WORKFLOW.getRequestContext();

private static final Logger log = LogManager.getLogger( WikiContext.class );
private static final Logger LOG = LogManager.getLogger( WikiContext.class );

private static final Permission DUMMY_PERMISSION = new PropertyPermission( "os.name", "read" );

Expand Down Expand Up @@ -219,7 +219,7 @@ public WikiContext( final Engine engine, final HttpServletRequest request, final
// Debugging...
final HttpSession session = ( request == null ) ? null : request.getSession( false );
final String sid = session == null ? "(null)" : session.getId();
log.debug( "Creating WikiContext for session ID={}; target={}", sid, getName() );
LOG.debug( "Creating WikiContext for session ID={}; target={}", sid, getName() );

// Figure out what template to use
setDefaultTemplate( request );
Expand Down
8 changes: 4 additions & 4 deletions jspwiki-main/src/main/java/org/apache/wiki/WikiServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class WikiServlet extends HttpServlet {

private static final long serialVersionUID = 3258410651167633973L;
private Engine m_engine;
private static final Logger log = LogManager.getLogger( WikiServlet.class.getName() );
private static final Logger LOG = LogManager.getLogger( WikiServlet.class.getName() );

/**
* {@inheritDoc}
Expand All @@ -53,7 +53,7 @@ public class WikiServlet extends HttpServlet {
public void init( final ServletConfig config ) throws ServletException {
super.init( config );
m_engine = Wiki.engine().find( config );
log.info( "WikiServlet initialized." );
LOG.info( "WikiServlet initialized." );
}

/**
Expand All @@ -65,7 +65,7 @@ public void init( final ServletConfig config ) throws ServletException {
*/
@Override
public void destroy() {
log.info( "WikiServlet shutdown." );
LOG.info( "WikiServlet shutdown." );
m_engine.stop();
super.destroy();
}
Expand All @@ -85,7 +85,7 @@ public void doPost( final HttpServletRequest req, final HttpServletResponse res
public void doGet( final HttpServletRequest req, final HttpServletResponse res ) throws IOException, ServletException {
String pageName = URLConstructor.parsePageFromURL( req, m_engine.getContentEncoding() );

log.info( "Request for page: {}", pageName );
LOG.info( "Request for page: {}", pageName );
if( pageName == null ) {
pageName = m_engine.getFrontPage(); // FIXME: Add special pages as well
}
Expand Down
8 changes: 4 additions & 4 deletions jspwiki-main/src/main/java/org/apache/wiki/WikiSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
public class WikiSession implements Session {

private static final Logger log = LogManager.getLogger( WikiSession.class );
private static final Logger LOG = LogManager.getLogger( WikiSession.class );

private static final String ALL = "*";

Expand Down Expand Up @@ -419,7 +419,7 @@ protected void injectUserProfilePrincipals() {
final String searchId = m_loginPrincipal.getName();
if ( searchId == null ) {
// Oh dear, this wasn't an authenticated user after all
log.info("Refresh principals failed because WikiSession had no user Principal; maybe not logged in?");
LOG.info("Refresh principals failed because WikiSession had no user Principal; maybe not logged in?");
return;
}

Expand Down Expand Up @@ -447,7 +447,7 @@ protected void injectUserProfilePrincipals() {
} catch ( final NoSuchPrincipalException e ) {
// We will get here if the user has a principal but not a profile
// For example, it's a container-managed user who hasn't set up a profile yet
log.warn("User profile '" + searchId + "' not found. This is normal for container-auth users who haven't set up a profile yet.");
LOG.warn("User profile '" + searchId + "' not found. This is normal for container-auth users who haven't set up a profile yet.");
}
}

Expand Down Expand Up @@ -494,7 +494,7 @@ public static void removeWikiSession( final Engine engine, final HttpServletRequ
*/
public static Session getWikiSession( final Engine engine, final HttpServletRequest request ) {
if ( request == null ) {
log.debug( "Looking up WikiSession for NULL HttpRequest: returning guestSession()" );
LOG.debug( "Looking up WikiSession for NULL HttpRequest: returning guestSession()" );
return staticGuestSession( engine );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class WikiAjaxDispatcherServlet extends HttpServlet {

private static final long serialVersionUID = 1L;
private static final Map< String, AjaxServletContainer > ajaxServlets = new ConcurrentHashMap<>();
private static final Logger log = LogManager.getLogger( WikiAjaxDispatcherServlet.class.getName() );
private static final Logger LOG = LogManager.getLogger( WikiAjaxDispatcherServlet.class.getName() );
private String PATH_AJAX = "/ajax/";
private Engine m_engine;

Expand All @@ -67,7 +67,7 @@ public void init( final ServletConfig config ) throws ServletException {
super.init( config );
m_engine = Wiki.engine().find( config );
PATH_AJAX = "/" + TextUtil.getStringProperty( m_engine.getWikiProperties(), "jspwiki.ajax.url.prefix", "ajax" ) + "/";
log.info( "WikiAjaxDispatcherServlet initialized." );
LOG.info( "WikiAjaxDispatcherServlet initialized." );
}

/**
Expand All @@ -93,7 +93,7 @@ public static void registerServlet( final String alias, final WikiAjaxServlet se
* @param perm the permission required to execute the servlet.
*/
public static void registerServlet( final String alias, final WikiAjaxServlet servlet, final Permission perm ) {
log.info( "WikiAjaxDispatcherServlet registering " + alias + "=" + servlet + " perm=" + perm );
LOG.info( "WikiAjaxDispatcherServlet registering " + alias + "=" + servlet + " perm=" + perm );
ajaxServlets.put( alias, new AjaxServletContainer( alias, servlet, perm ) );
}

Expand Down Expand Up @@ -133,9 +133,9 @@ private void performAction( final HttpServletRequest req, final HttpServletRespo
req.setCharacterEncoding( m_engine.getContentEncoding().displayName() );
res.setCharacterEncoding( m_engine.getContentEncoding().displayName() );
final String actionName = AjaxUtil.getNextPathPart( req.getRequestURI(), servlet.getServletMapping() );
log.debug( "actionName=" + actionName );
LOG.debug( "actionName=" + actionName );
final String params = req.getParameter( "params" );
log.debug( "params=" + params );
LOG.debug( "params=" + params );
List< String > paramValues = new ArrayList<>();
if( params != null ) {
if( StringUtils.isNotBlank( params ) ) {
Expand All @@ -144,10 +144,10 @@ private void performAction( final HttpServletRequest req, final HttpServletRespo
}
servlet.service( req, res, actionName, paramValues );
} else {
log.warn( "Servlet container " + container + " not authorised. Permission required." );
LOG.warn( "Servlet container " + container + " not authorised. Permission required." );
}
} else {
log.error( "No registered class for servletName=" + servletName + " in path=" + path );
LOG.error( "No registered class for servletName=" + servletName + " in path=" + path );
throw new ServletException( "No registered class for servletName=" + servletName );
}
}
Expand Down
Loading