congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
LogUtils.getUrl
Code IndexAdd Tabnine to your IDE (free)

How to use
getUrl
method
in
leap.lang.logging.LogUtils

Best Java code snippets using leap.lang.logging.LogUtils.getUrl (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.loggingLogUtilsgetUrl

Javadoc

Returns the url for logging.

Popular methods of LogUtils

    Popular in Java

    • Making http post requests using okhttp
    • scheduleAtFixedRate (Timer)
    • getContentResolver (Context)
    • getExternalFilesDir (Context)
    • Container (java.awt)
      A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • FileWriter (java.io)
      A specialized Writer that writes to a file in the file system. All write requests made by calling me
    • Path (java.nio.file)
    • ArrayList (java.util)
      ArrayList is an implementation of List, backed by an array. All optional operations including adding
    • TreeSet (java.util)
      TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
    • Top 17 Free Sublime Text 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