String _source; if(source == null) { _source = Thread.currentThread().getName(); if(_source == null) { _source = Thread.currentThread().getClass().getName(); } } else if(source instanceof Class) _source = ((Class)source).getName(); else _source = source.getClass().getName(); int index = _source.lastIndexOf('.'); if(index != -1) _source = _source.substring(index+1);  if(message instanceof Throwable) { _logException(urgency,source,(Throwable)message); } else { String _message = String.valueOf(message);   synchronized(LOCK) { StringTokenizer st = new StringTokenizer( _message,"\r\n"); int lineCount = 0; boolean oldWrap = wrap; while(st.hasMoreTokens()) { lineCount++; _log(urgency,_source,st.nextToken() .replace('\t',' ')); } listModel.update(lineCount,oldWrap); } }
log(urgency,source,message); log(urgency,source,exception);
	public static void log(int urgency, Object source, Object message)	{		String _source;		if(source == null)		{			_source = Thread.currentThread().getName();			if(_source == null)			{				_source = Thread.currentThread().getClass().getName();			}		}		else if(source instanceof Class)			_source = ((Class)source).getName();		else			_source = source.getClass().getName();		int index = _source.lastIndexOf('.');		if(index != -1)			_source = _source.substring(index+1);		if(message instanceof Throwable)		{			_logException(urgency,source,(Throwable)message);		}		else		{			String _message = String.valueOf(message);			// If multiple threads log stuff, we don't want			// the output to get mixed up			synchronized(LOCK)			{				StringTokenizer st = new StringTokenizer(					_message,"\r\n");				int lineCount = 0;				boolean oldWrap = wrap;				while(st.hasMoreTokens())				{					lineCount++;					_log(urgency,_source,st.nextToken()						.replace('\t',' '));				}				listModel.update(lineCount,oldWrap);			}		}	} //}}}