gpt4 book ai didi

com.quinsoft.zeidon.ZeidonLogger类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 11:03:28 26 4
gpt4 key购买 nike

本文整理了Java中com.quinsoft.zeidon.ZeidonLogger类的一些代码示例,展示了ZeidonLogger类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZeidonLogger类的具体详情如下:
包路径:com.quinsoft.zeidon.ZeidonLogger
类名称:ZeidonLogger

ZeidonLogger介绍

[英]Extends SLF4J logger with some convenience methods.
[中]使用一些方便的方法扩展SLF4J记录器。

代码示例

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

private void close(ResultSet rs)
{
  try
  {
    if (rs != null)
    {
      rs.close();
    }
  }
  catch (SQLException e)
  {
    task.dblog().error( e );
  }
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

logger.info( "%s %s", key, value );

代码示例来源:origin: com.quinsoft.zeidon/object-browser

@Override
  public void actionPerformed( ActionEvent e )
  {
    if ( e.getActionCommand().equals( "OK" ) )
    {
      task.log().setLevel( group.getSelection().getActionCommand() );
      task.dblog().setLevel( group.getSelection().getActionCommand() );
      frame.dispose();
      return;
    }
    task.log().setLevel( e.getActionCommand() );
    task.dblog().setLevel( e.getActionCommand() );
  }
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

/**
 * Writes the SQL to the log if either log() or dblog() has DEBUG on.
 *
 * @param sql
 */
protected void logSql( String sql )
{
  if ( task.log().isDebugEnabled() )
    task.log().debug( "<SQL>\n%s\n</SQL>", sql );
  else
  if ( task.dblog().isDebugEnabled() )
    task.dblog().debug( "<SQL>\n%s\n</SQL>", sql );
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

private void readFileMeta() throws Exception
{
  jp.nextToken();
  while ( jp.nextToken() != JsonToken.END_OBJECT )
  {
    String fieldName = jp.getCurrentName();
    jp.nextToken(); // Move to value.
    switch ( fieldName )
    {
      case "version":
        version = jp.getValueAsString();
        task.log().debug( "JSON version: %s", version );
        break;
      case "date":
        break;
      default:
        task.log().warn( "Unknown .oimeta fieldname %s", fieldName );
    }
  }
  jp.nextToken();
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

protected boolean appendString( SqlStatement stmt, StringBuilder buffer, Object value )
{
  String str = value.toString();
  if ( str.length() > MAX_INLINE_STRING_LENGTH || bindAllValues)
  {
    if ( getTask().dblog().isTraceEnabled() )
      getTask().dblog().trace( "Bound string: length = %d, value = %s...", str.length(), StringUtils.substring( str, 0, 50 ) );
    stmt.addBoundAttribute( buffer, value );
  }
  else
  {
    buffer.append( "'" ).append( StringUtils.replace( str, "'", "''" ) ).append( "'" );
  }
  return true;
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

task.log().debug( "Caught exception writing pessimisic locks on %s.  Trying again", lodDef );
break;
task.log().info( "Caught exception writing pessimisic locks on %s.  Trying again", lodDef );
break;
task.log().warn( "Caught exception writing pessimisic locks on %s.  Trying again", lodDef );
lockOi.logObjectInstance();

代码示例来源:origin: com.quinsoft.zeidon/object-browser

void warn( String format, Object...args )
{
  oe.getSystemTask().log().warn( format, args );
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

InputStream stream = response.getEntity().getContent();
StatusLine status = response.getStatusLine();
task.log().info( "Status from http activate = %s", status );
int statusCode = status.getStatusCode();
if ( task.log().isDebugEnabled() || statusCode != 200 )
  task.log().debug( "REST response: %s", stringResponse );
  stream = IOUtils.toInputStream(stringResponse, "UTF-8");

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

@Override
public boolean beginTransaction(View view )
{
  getTask().dblog().debug( "TestSql: Begin Transaction" );
  return true;
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

task.dblog().debug( "setMaxRows = %d", stmt.activateLimit );
  ps.setMaxRows( stmt.activateLimit );
task.dblog().trace( "Using cached statement for Entity => %s \n=> %s", entityDef, sql );
ps = value.ps;
task.dblog().debug( "setMaxRows = %d", stmt.activateLimit );
ps.setMaxRows( stmt.activateLimit );
if ( task.dblog().isDebugEnabled() )
  task.dblog().debug( "Bind idx %d = %s (attr value)", idx, leftStr( valueAsString ) );

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

@Override
public void validateInternalValue( Task task, AttributeDef attributeDef, Object internalValue ) throws InvalidAttributeValueException
{
  String phone = checkNullString( internalValue );
  if ( phone != null && phone.isEmpty( ) == false )
  {
    // Checks for US style telephone numbers ...
    // 10 digit accepts () around area code, and doesn't allow preceeding 1 as country code
    // Phone Number formats: (nnn)nnn-nnnn; nnnnnnnnnn; nnn-nnn-nnnn
    // ^\\(? : May start with an optional "(" .
    // (\\d{3}): Followed by 3 digits.
    // \\)? : May have an optional ")"
    // [- ]? : May have an optional "-" after the first 3 digits or after optional ) character.
    // (\\d{3}) : Followed by 3 digits.
    // [- ]? : May have another optional "-" after numeric digits.
    // (\\d{4})$ : ends with four digits.
  // String expressionPhone = "(?:(?:(\\s*\\(?([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\)?\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})";
    String expression = "^[+]?\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$"; // e.g.  matches following phone numbers: (123)456-7890, 123-456-7890, 1234567890, (123)-456-7890
    CharSequence inputStr = phone;
    Pattern pattern = Pattern.compile( expression );
    Matcher matcher = pattern.matcher( inputStr );
    if ( matcher.matches( ) == false )
    {
      task.log().trace( "Invalid telephone number: " + phone );
      throw new InvalidAttributeValueException( attributeDef, phone, "Value must be a valid phone number" );
    }
    phone = phone.replaceAll( "[^0-9]", "" );
  }
  super.validateInternalValue( task, attributeDef, phone );
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

@Override
public void endTransaction(boolean commit)
{
  try
  {
    // Close any statements that were cached.
    if ( cachedStatements != null )
    {
      for ( PreparedStatementCacheValue v : cachedStatements.values() )
        DbUtils.closeQuietly( v.ps );
      task.dblog().trace( "Loaded %d statements from cache\nTotal cache size = %d",
                cachedStatementCount, cachedStatements.size() );
      cachedStatements.clear();
    }
    if ( closeTransaction )
    {
      if ( commit )
        transaction.getConnection().commit();
      else
        transaction.getConnection().rollback();
      transaction.close();
      task.dblog().debug( "JDBC: closed transaction" );
      transaction = null;
    }
  }
  catch ( Throwable e )
  {
    throw ZeidonException.prependMessage( e, "JDBC = %s", options.getOiSourceUrl() );
  }
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

protected void logSql( SqlStatement sql )
{
  if ( task.log().isDebugEnabled() || task.dblog().isDebugEnabled() )
    logSql( sql.toString() );
}

代码示例来源:origin: com.quinsoft.zeidon/object-browser

SetLogLevelAction action = new SetLogLevelAction( t, frame, group );
String currentLevel = t.log().getLoggerLevel().toString();

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

private EntityMeta readEntityMeta(EntityInstanceImpl ei) throws Exception
{
  EntityMeta meta = new EntityMeta();
  while ( jp.nextToken() != JsonToken.END_OBJECT )
  {
    String fieldName = jp.getCurrentName();
    switch ( fieldName )
    {
      case  "incrementals" :   readIncrementals( meta ); break;
      case  "isLinkedSource" : meta.isLinkedSource = true; break;
      case  "entityKey" :      meta.entityKey = jp.getText(); break;
      case  "linkedSource" :   meta.linkedSource = jp.getText(); break;
      case  "selected" :       selectedInstances.add( ei ); break;
      case  "incomplete" :     meta.incomplete = true; break;
      case  "lazyLoaded" :     meta.lazyLoaded = jp.getText(); break;
      default: task.log().warn( "Unknown entity meta value %s", fieldName );
    }
  }
  entityMetas.put( ei, meta );
  return meta;
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

@SuppressWarnings("unchecked")
  @Override
  public Domain loadDomain(Application application, Map<String, Object> domainProperties, Task task)
  {
    try
    {
      String className = (String) domainProperties.get( "JavaClass" );
      String domainName = (String) domainProperties.get( "Name" );
      Class<? extends Domain> cl = null;
      ClassLoader classLoader = getClass().getClassLoader();
      cl = (Class<? extends Domain>) classLoader.loadClass( className );
      Constructor<? extends Domain> constructor = cl.getConstructor( constructorArgTypes);
      Domain domain = constructor.newInstance( application, domainProperties, task );
      task.log().debug( "Loaded class %s for domain %s", className, domainName );
      return domain;
    }
    catch ( Throwable t )
    {
      throw ZeidonException.wrapException( t );
    }
  }
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

task.log().debug( "Found resource at " + element );
else
  LOG.debug( "--Found resource at " + element );
    task.log().warn( "Multiple, identical resources found of %s.  This usually means your classpath has duplicates", resourceName );
  else
    LOG.warn( "Multiple, identical resources found of " + resourceName + " This usually means your classpath has duplicates" );

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

@Override
public void acquireGlobalLock( View view ) throws PessimisticLockingException
{
  createLockOi( task );
  addGlobalLockToLockOi();
  addQualLocksToLockOi();
  // To minimize attempts to write to the DB we'll use a global Java
  // lock to single-thread writes for the current JVM.
  view.log().trace( "Locking global Java lock" );
  getJavaLock().lock.lock();
  view.log().trace( "Global Java acquired" );
  writeLocks( view );
}

代码示例来源:origin: com.quinsoft.zeidon/zeidon-joe

if ( task.dblog().isDebugEnabled() )
      task.dblog().debug( "Activated %d %s entities for %s", entityCounts.get( ve ), ve, parentCursor );
      task.dblog().debug( "Activated %d %s entities", entityCounts.get( ve ), ve );

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com