jelp

Java Eclipse Logging Plugin

What

jelp is an eclipse plugin to automatically create standardized log statements in existing java code.

Where

jelp can be installed from the following eclipse update site.

https://thodelu.bitbucket.io/jelp/update/

jelp can also be installed from eclipse marketplace.

Dependency

Currently, jelp only works with slf4j logging framework.

How

jelp usage

Standards

Method Calls

Method calls are logged in the location where the method is being invoked from. This is different from the conventional logging practice to log the method call from inside the method declaration using an entry and exit statements. The log level is determined by which method is getting invoked.

Method Call Log Level
Invocation of a static method. NONE
Invocation of a method declared in the same class. TRACE
Invocation of a method declared in the same package. DEBUG
Invocation of a method declared else where in the source. INFO
Invocation of a library method, not declared in the source. DEBUG

Example

						
public void method1(Object arg) {
	method2(arg);
	JELP.trace("method1|invoke|method2|{}", arg);
}
						
					

Variable Declarations

Variable Declarations are only logged if they involve a Method Invocation. The level is determined by the nature of Method call.

Example

						
public void method1(Object arg) {
	int result = method2(arg);
	JELP.trace("method1|assign|result|{}", result);
}
						
					

Control Flow

Control Flows (if/else, switch/case, for, while, do-while) are logged at TRACE level.

Example

						
public void method1(Object arg) {
	for (int i = 0; i < 10; i++) {
		JELP.trace("method1|for|i");
		...
	}
}
						
					

Exceptions

Exceptions are obviously logged at ERROR level.

Example

						
public void method1(Object arg) {
	try {
		method2();
	} catch (Exception e) {
		JELP.error("method1|exception|{}", e);
	}
}
						
					

Preferences

jelp allows the following preferences to be modified.

jelp preferences

More Info