List of usage examples for org.apache.commons.logging LogFactory getLog
public static Log getLog(String name)
From source file:net.sf.nmedit.jtheme.image.ToolkitImageResource.java
@Override public Image getImage(int width, int height) { if (!(imageInitialized)) { imageInitialized = true;//from w w w .j av a 2 s.c o m try { image = ImageIO.read(getEnsureResolvedURL()); } catch (IOException e) { Log log = LogFactory.getLog(getClass()); if (log.isErrorEnabled()) log.error("getImage() failed", e); } } return image; }
From source file:net.pandoragames.far.ui.swing.dialog.SubWindow.java
/** * Always specify owner and title. The window will be created non-modal. * @param owner top level window/* w w w. java2 s. c om*/ * @param title for this window */ public SubWindow(JFrame owner, String title) { super(owner, title, false); logger = LogFactory.getLog(this.getClass()); }
From source file:edu.umich.robot.soar.SetHeadingLinearCommand.java
public SetHeadingLinearCommand(Identifier wme, SoarAgent agent) throws SoarCommandError { super(wme, agent.getEvents(), LogFactory.getLog(SetHeadingLinearCommand.class)); this.output = agent.getRobotOutput(); double targetYaw = CommandParameters.requireDouble(wme, IOConstants.YAW); targetYaw = agent.getProperties().get(AgentProperties.ANGLE_UNIT).fromView(targetYaw); this.targetYaw = targetYaw; double linearVelocity = CommandParameters.requireDouble(wme, IOConstants.LINEAR_VELOCITY); linearVelocity = agent.getProperties().get(AgentProperties.LINEAR_SPEED_UNIT).fromView(linearVelocity); addEvent(new DriveHeadingAndLinearEvent(targetYaw, linearVelocity), AbstractDriveEvent.class); }
From source file:com.alfaariss.oa.profile.aselect.binding.protocol.cgi.CGIResponse.java
/** * Creates the object from the supplied servlet response. * @param oResponse the servlet response *//*from w w w. j a v a 2s. c o m*/ public CGIResponse(HttpServletResponse oResponse) { _logger = LogFactory.getLog(CGIResponse.class); _servletResponse = oResponse; _sbResponse = new StringBuffer(); }
From source file:ductive.log.JDKToCommonsHandler.java
@Override public void publish(LogRecord record) { String name = record.getLoggerName(); Log log = logs.get(name);//from w w w. ja va2s . c om if (log == null) logs.put(name, log = LogFactory.getLog(name)); String message = record.getMessage(); Throwable ex = record.getThrown(); Level level = record.getLevel(); if (Level.SEVERE == level) log.error(message, ex); else if (Level.WARNING == level) log.warn(message, ex); else if (Level.INFO == level) log.info(message, ex); else if (Level.CONFIG == level) log.debug(message, ex); else log.trace(message, ex); }
From source file:it.caladyon.akka.commonslog.CommonsLoggingLogger.java
@Override public void onReceive(Object message) throws Exception { if (message instanceof InitializeLogger) { loggerLog.info(message);//from w w w. j ava2 s . c o m getSender().tell(Logging.loggerInitialized(), getSelf()); } else if (message instanceof Error) { Log log = LogFactory.getLog(((Error) message).logClass()); if (((Error) message).cause() == null) { log.error(composeMessage((LogEvent) message)); } else { log.error(composeMessage((LogEvent) message), ((Error) message).cause()); } } else if (message instanceof Warning) { Log log = LogFactory.getLog(((Warning) message).logClass()); log.warn(composeMessage((LogEvent) message)); } else if (message instanceof Info) { Log log = LogFactory.getLog(((Info) message).logClass()); if (log.isInfoEnabled()) { log.info(composeMessage((LogEvent) message)); } } else if (message instanceof Debug) { Log log = LogFactory.getLog(((Debug) message).logClass()); if (log.isDebugEnabled()) { log.debug(composeMessage((LogEvent) message)); } } }
From source file:name.livitski.tools.proper2.Configuration.java
/** * Creates the settings container for a host class. * @param forClass the class of object that is configured using this * settings container// ww w . ja v a2 s. c o m */ public Configuration(Class<?> forClass) { this.forClass = forClass; this.log = LogFactory.getLog(forClass); }
From source file:net.sf.nmedit.nomad.core.NomadPlugin.java
public void startApplication() throws Exception { Log log = LogFactory.getLog(getClass()); if (log != null) logOsInfo(log);//w ww .java 2 s.com final NomadLoader loader = new NomadLoader(); nomad = loader.createNomad(NomadPlugin.this); SwingUtilities.invokeLater(new Runnable() { public void run() { // invoke on event dispatch thread nomad.setupUI(); loader.initServices(); nomad.setupMenu(); // after service so they can install custom menu items nomad.getWindow().invalidate(); nomad.getWindow().validate(); nomad.getWindow().setVisible(true); } }); }
From source file:com.alfaariss.oa.authentication.password.digest.HtPasswdMD5Digest.java
/** * Constructor./*from w w w .ja v a2 s.c o m*/ * @param sCommand The MD5 command String. */ public HtPasswdMD5Digest(String sCommand) { super(); _sCommand = sCommand; _systemLogger = LogFactory.getLog(this.getClass()); }
From source file:com.alfaariss.oa.engine.core.idp.storage.AbstractIDP.java
/** * Constructor. /*from w ww . j a va2 s . com*/ * @param id The IDP ID. * @param friendlyname The IDP friendly name. */ public AbstractIDP(String id, String friendlyname, Date dLastModified) { _logger = LogFactory.getLog(this.getClass()); _sID = id; _sFriendlyName = friendlyname; _dLastModified = dLastModified; }