Skip to content

Commit

Permalink
Turns some info messages into debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
joaobispo committed Sep 19, 2024
1 parent 88ec555 commit 76bce47
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,22 @@
*/
package org.lara.interpreter.joptions.config.interpreter;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import javax.xml.parsers.ParserConfigurationException;

import com.google.common.base.Preconditions;
import com.google.gson.Gson;
import larai.LaraI;
import larai.larabundle.LaraBundle;
import larai.lararesource.LaraResource;
import org.lara.interpreter.exception.LaraIException;
import org.lara.interpreter.joptions.keys.FileList;
import org.lara.interpreter.joptions.keys.OptionalFile;
import org.lara.interpreter.utils.Tools;
import org.lara.interpreter.weaver.interf.WeaverEngine;
import org.lara.interpreter.weaver.options.WeaverOption;
import org.suikasoft.jOptions.JOptionKeys;
import org.suikasoft.jOptions.JOptionsUtils;
import org.suikasoft.jOptions.Datakey.DataKey;
import org.suikasoft.jOptions.Interfaces.DataStore;
import org.suikasoft.jOptions.JOptionKeys;
import org.suikasoft.jOptions.JOptionsUtils;
import org.xml.sax.SAXException;

import com.google.common.base.Preconditions;
import com.google.gson.Gson;

import larai.LaraI;
import larai.larabundle.LaraBundle;
import larai.lararesource.LaraResource;
import pt.up.fe.specs.git.GitRepos;
import pt.up.fe.specs.jsengine.JsEngineType;
import pt.up.fe.specs.lara.aspectir.Argument;
Expand All @@ -51,12 +37,17 @@
import pt.up.fe.specs.util.properties.SpecsProperties;
import pt.up.fe.specs.util.utilities.StringList;

import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;

/**
* TODO: Should deprecate and just use DataStore directly?
* TODO: Also, the "ifs" in the getters interfere with the default values set in the DataKey
*
* @author JoaoBispo
*
* @author JoaoBispo
*/
public class LaraIDataStore implements LaraiKeys {

Expand Down Expand Up @@ -131,7 +122,7 @@ private DataStore mergeSystemAndLocalOptions(WeaverEngine weaverEngine, DataStor

var defaultOptionsFile = defaultOptions.getConfigFile().orElse(null);
if (defaultOptionsFile != null) {
SpecsLogs.info("Loading default options in file '" + defaultOptionsFile.getAbsolutePath() + "'");
SpecsLogs.debug("Loading default options in file '" + defaultOptionsFile.getAbsolutePath() + "'");
}

SpecsLogs.debug(() -> "Loading system-wide options");
Expand Down Expand Up @@ -377,7 +368,7 @@ public boolean isLaraLoc() {
/**
* Returns a JSON string representing the aspect arguments. If the value represents a json file, reads it before
* returning.
*
*
* @return the aspect arguments as a JSON string
*/
public String getAspectArgumentsStr() {
Expand Down
9 changes: 4 additions & 5 deletions LARAI/src/org/lara/interpreter/weaver/LaraWeaverState.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public class LaraWeaverState {
private URLClassLoader classLoader;

/**
*
* @param dataStore DataStore that supports LaraIKeys
*/
public LaraWeaverState(DataStore dataStore) {
Expand All @@ -48,7 +47,7 @@ private void loadJars() {
var urls = jarFiles.stream()
.map(f -> {
try {
System.out.println("Loading JAR " + f);
SpecsLogs.debug(() -> "Loading JAR " + f);
return f.toURI().toURL();
} catch (MalformedURLException e) {
throw new RuntimeException("Could not convert JAR file to URL", e);
Expand All @@ -65,9 +64,9 @@ private List<File> getJarFiles() {

var jarFiles = new ArrayList<File>();

for(var jarPath : jarPaths) {
if(!jarPath.exists()) {
SpecsLogs.info("Jar path '"+jarPath+"' does not exist");
for (var jarPath : jarPaths) {
if (!jarPath.exists()) {
SpecsLogs.info("Jar path '" + jarPath + "' does not exist");
continue;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
/**
* Copyright 2023 SPeCS.
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. under the License.
*/

package org.lara.interpreter.weaver.interf;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import pt.up.fe.specs.util.SpecsIo;
import pt.up.fe.specs.util.SpecsLogs;
import pt.up.fe.specs.util.SpecsStrings;
import pt.up.fe.specs.util.SpecsSystem;
import pt.up.fe.specs.util.providers.ResourceProvider;
import pt.up.fe.specs.util.utilities.StringLines;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
* Manages a set of resources as files on disk, considering they come from, or will be used by NPM packages.
*/
Expand Down Expand Up @@ -60,7 +60,7 @@ public File getCoreFolder() {
}

/**
*
*
* @return a list of folders inside the node_modules folder that correspond to the base folders that laraImport
* should look for APIs
*/
Expand All @@ -84,7 +84,7 @@ public List<File> getNpmApiFolders() {
}

/**
*
*
* @return a list of files named core.js inside the node_modules folder that should be executed to enable the core
* LARA environment
*/
Expand Down Expand Up @@ -120,7 +120,7 @@ public static WeaverApiManager newInstance(WeaverEngine engine) {
prepareCoreFolder(baseFolder, engine);

// Get base folder
SpecsLogs.msgInfo("Weaver API manager: using '" + baseFolder.getAbsolutePath() + "' as base folder");
SpecsLogs.debug(() -> "Weaver API manager: using '" + baseFolder.getAbsolutePath() + "' as base folder");
return new WeaverApiManager(baseFolder);
}

Expand Down Expand Up @@ -232,7 +232,7 @@ private static void extractNpmResources(File destination, WeaverEngine engine) {
}

/**
*
*
* @param resourcesFolder
* @return if true, means that resources need to be extracted to files, false means that folder can be reused as-is
*/
Expand Down

0 comments on commit 76bce47

Please sign in to comment.