congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
LogUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
LogUtils
in
leap.lang.logging

Best Java code snippets using leap.lang.logging.LogUtils (Showing top 7 results out of 315)

origin: org.leapframework/leap-lang

/**
 * Returns the url for logging.
 */
public static String getUrl(Resource r) {
  if(null == r) {
    return null;
  }
  return getUrl(r.getURLString());
}
origin: org.leapframework/leap-core

protected void putProperty(AppPropertyContext context, Resource resource, String key, String value, boolean override) {
  if(!override && context.hasProperty(key)) {
    AppProperty prop = context.getProperty(key);
    if(null != prop) {
      if(prop.isOverride()) {
        log.debug("Skip {} at {}, a override one already exists", key, LogUtils.getUrl(resource));
        return;
      }
      throw new AppConfigException("Found duplicate property '" + key + "' in resources : [" +
          prop.getSource() + "]" + ", " + LogUtils.getUrl(resource));
    }else {
      throw new AppConfigException("Found duplicate property '" + key + "' in '" + LogUtils.getUrl(resource) +
                     "', the array property with same name already exists!");
    }
  }
  context.putProperty(resource, key, value, override);
}
origin: org.leapframework/leap-core

public void load(AppResource[] resources) {
  Args.notNull(resources, "resources");
  for (AppResource ar : resources) {
    Resource resource = ar.getResource();
    if (log.isDebugEnabled()) {
      if (AppResources.isFrameworkAndCoreResource(resource.getURLString())) {
        log.trace("Load beans : {}", LogUtils.getUrl(resource));
      } else {
        log.debug("Load beans : {}", LogUtils.getUrl(resource));
      }
    }
    //todo : use AppResource's default override?
    readDefinitions(container, resource, ar.isDefaultOverride());
  }
}
origin: org.leapframework/leap-core

protected void loadProperties(ConfigContext context, AppResource... resources) {
  for(AppResource ar : resources){
    try{
      Resource resource  = ar.getResource();
      String resourceUrl = resource.getURL().toString();
      if(log.isDebugEnabled()){
        if(AppResources.isFrameworkAndCoreResource(resourceUrl)) {
          log.trace("Load properties : {}", LogUtils.getUrl(resource));
        }else{
          log.debug("Load properties : {}", LogUtils.getUrl(resource));
        }
      }
      if(context.resources.contains(resourceUrl)){
        throw new AppConfigException("Cycle importing detected of '" + resourceUrl + "', please check your config : " + resourceUrl);
      }
      context.resources.add(resourceUrl);
      context.setDefaultOverride(ar.isDefaultOverride());
      for(AppPropertyReader reader : propertyReaders) {
        if(reader.readProperties(context, resource)) {
          break;
        }
      }
      context.resetDefaultOverride();
    }catch(IOException e) {
      throw new AppConfigException("I/O Exception",e);
    }
  }
}
origin: org.leapframework/leap-core

private void loadConfig(ConfigContext context, AppResource... resources){
  for(AppResource ar : resources){
    try{
      Resource resource  = ar.getResource();
      String resourceUrl = resource.getURL().toString();
      if(log.isDebugEnabled()){
        if(AppResources.isFrameworkAndCoreResource(resourceUrl)) {
          log.trace("Load config : {}", LogUtils.getUrl(resource));
        }else{
          log.debug("Load config : {}", LogUtils.getUrl(resource));
        }
      }
      if(context.resources.contains(resourceUrl)){
        throw new AppConfigException("Cycle importing detected of '" + resourceUrl + "', please check your config : " + resourceUrl);
      }
      context.resources.add(resourceUrl);
      context.setDefaultOverride(ar.isDefaultOverride());
      for(AppConfigReader reader : configReaders) {
        if(reader.readConfig(context, resource)) {
          break;
        }
      }
      context.resetDefaultOverride();
    }catch(IOException e) {
      throw new AppConfigException("I/O Exception",e);
    }
  }
}
origin: org.leapframework/leap-core

  log.debug("Found conf file : {}", LogUtils.getUrl(r));
}else{
  log.trace("Found conf file : {}", LogUtils.getUrl(r));
origin: org.leapframework/leap-core

protected PrintProperty toPrintProperty(AppProperty p) {
  PrintProperty pp = new PrintProperty();
  String value = protectSecret(p.getName(), p.getUnprocessedValue());
  pp.name  = p.getName();
  pp.value = Strings.abbreviateMiddle(value, "...", 50);
  pp.value = Strings.replace(pp.value, "\r", "\\r");
  pp.value = Strings.replace(pp.value, "\n", "\\n");
  if(null == p.getSource()) {
    pp.source = "(n/a)";
  }else if(p.getSource() instanceof Resource) {
    pp.source = LogUtils.getUrl((Resource)p.getSource());
  }else if(p.getSource() instanceof Class) {
    pp.source = ((Class) p.getSource()).getSimpleName();
  }else if(p.getSource() instanceof String) {
    pp.source = (String)p.getSource();
  }else {
    pp.source = p.getSource().getClass().getSimpleName();
  }
  pp.source = Strings.abbreviatePrefix(pp.source, 10, 80, "...");
  pp.system = p.isSystem();
  return pp;
}
leap.lang.loggingLogUtils

Most used methods

  • getUrl
    Returns the url for logging.

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now