We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code for the configuration:
public static Configuration getTracingConfiguration() { return new Configuration.Builder() .setTrackerClass("io.ghostwriter.GhostWriter") .setInclude(getPropertyConfig("GHOSTWRITER_INCLUDE", new String[] {})) .setExclude(getPropertyConfig("GHOSTWRITER_EXCLUDE", new String[] {})) .setIncludeByAnnotation(setIfPropertyExists("GHOSTWRITER_ANNOTATED_ONLY", new String[] {"io.ghostwriter.annotation.Include"})) .setExcludeByAnnotation(Arrays.asList("io.ghostwriter.annotation.Exclude")) .setExcludeMethodsByName(getPropertyConfig("GHOSTWRITER_EXCLUDE_METHODS", new String[] {"toString", "equals", "hashCode", "compareTo"})) .setIncludeLambdas(false) .setTrackReturn(getPropertyConfig("GHOSTWRITER_TRACE_RETURNING", true)) .setTrackUnhandledException(getPropertyConfig("GHOSTWRITER_TRACE_ON_ERROR", true)) .setTrackLocalVariableStateChange(getPropertyConfig("GHOSTWRITER_TRACE_VALUE_CHANGE", true)) .setTrackFieldStateChanges(false) .setMinimumMethodLoc(getPropertyConfig("GHOSTWRITER_SHORT_METHOD_LIMIT", 0)) .build(); } private static List<String> getPropertyConfig(String propertyKey, final String[] defaultValues) { final String property = System.getProperty(propertyKey); final String[] params; if (property != null) { params = property.split(","); } else { params = defaultValues; } return Arrays.asList(params); } private static List<String> setIfPropertyExists(String propertyKey, final String[] values) { if (System.getProperty(propertyKey) != null) { return Arrays.asList(values); } else { return new ArrayList<String>(); } } private static boolean getPropertyConfig(String propertyKey, final boolean defaultValue) { String propertyValue = System.getProperty(propertyKey); if (propertyValue != null) { return Boolean.parseBoolean(propertyValue); } else { return defaultValue; } } private static int getPropertyConfig(String propertyKey, final int defaultValue) { String propertyValue = System.getProperty(propertyKey); if (propertyValue != null) { return Integer.parseInt(propertyValue); } else { return defaultValue; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code for the configuration:
The text was updated successfully, but these errors were encountered: