Comments (5)
I want to stress the point Martin has made here.
Error messages (not only when triggered by groovy code), do not provide enough detail, yet!
Especially the location of the error (at least: file and line; better: also class and method) should absolutely be included in any message (perhaps not necessarily on the canvas, but definitely in the log).
This would really help during debugging!
from vrl.
I've improved the msg for project code. As Martin suggests, the deepest msg is shown:
Especially the location of the error (at least: file and line; better: also class and method) should absolutely be included in any message (perhaps not necessarily on the canvas, but definitely in the log).
The behavior depends on the message type. If it is an exception all available information will be shown in the log. If it is an error message, such as Cannot establish connection
, there is no line number since this message is not based on an exception.
Please give some examples of error messages that do not behave as expected.
from vrl.
Thank you, Michael, for the partial fix.
Now, for example, I stumbled upon an exception caught in eu.mihosoft.vrl.io.vrlx.AbstractWindows, line 93:
for (AbstractWindow o : this) {
try {
CanvasWindow w = o.addToCanvas(mainCanvas);
windows.add(new Pair<CanvasWindow, AbstractWindow>(w, o));
} catch (Exception ex) {
mainCanvas.getMessageBox().addUniqueMessage(
"Error while loading windows!",
ex.toString()
+ " in method " + ex.getStackTrace()[0].getClassName()
+ ":" + ex.getStackTrace()[0].getMethodName()
+ " in file: " + ex.getStackTrace()[0].getFileName()
+ ":" + ex.getStackTrace()[0].getLineNumber(),
null, MessageType.ERROR);
ex.printStackTrace(System.out);
if (ex.getCause() != null) {
mainCanvas.getMessageBox().addUniqueMessage("Error Message!",
ex.getCause().toString(), null, MessageType.ERROR);
}
Logger.getLogger(AbstractWindows.class.getName()).
log(Level.SEVERE, null, ex);
}
}
This exception is only displayed on Canvas (not in the log in the application) and, unfortunately, no information as to where it originated is printed anywhere. This one was quite a bit of a nuisance to me until I finally found out where it came from.
Another example is in eu.mihosoft.vrl.reflection.TypeRepresentationBase in line 1372:
try {
...
} catch (Exception ex) {
ex.printStackTrace();
if (getMainCanvas() != null) {
MessageBox mBox = getMainCanvas().getMessageBox();
String message = ex.toString();
if (ex.getCause() != null) {
message += "\n>> " + ex.getCause().toString();
}
mBox.addUniqueMessage("Can't evaluate value options:",
"Class " + getType().getName() + "<br>" + ">> "
+ message, getConnector(), MessageType.WARNING);
}
Logger.getLogger(TypeRepresentationBase.class.getName()).
log(Level.SEVERE, null, ex);
}
Again, a message is displayed on the Canvas, yet no clue where the exception originates from.
In both cases, at least ex.getStackTrace()[0].getFileName() and ex.getStackTrace()[0].getLineNumber() could be called and the information be displayed. Personally, I would like to get a full stack trace in the log.
I suppose there will be more examples of that kind, however, those two have been in my particular way.
from vrl.
New logging behaviour:
VRL registers a custom log handler to further improve the error output. Every logger that uses parent handlers via rootLogger.setUseParentHandlers(true);
will be redirected to the log window. For loggers that don't use their parents redirection does not work since they can redirect to streams/files that are unknown. However, for most loggers this should be no problem.
Loggers with Level = SEVERE
and Level = WARNING
redirect to VRLs custom err stream. All others redirect to VRLs custom out stream.
Please report whether this fix works for you.
from vrl.
no activity
from vrl.
Related Issues (20)
- Method Selectors
- Model based instrumentation HOT 5
- ++ Operator bug
- Static method calls
- Consistent id generation for CodeEntities
- UI Performance HOT 1
- Use native FileChooser (JavaFX) if possible HOT 2
- VCanvas3D should allow to specify post rendering
- Session components are sometimes not identified correctly (wrong file name is reported) HOT 1
- Classpath cannot be processed on Windows
- Visual Debugging Idea (JOnsen)
- Flickering param value animation
- Add plain JComponent support
- Some of the integrated icons (close,source etc.) only respond to click events if no move is detected
- Rename Plugin Jars when installing plugins and support .vrlplugin extension
- On Windows VRL.loadPlugin(..) prevents file move from plugin-updates to plugins
- Help content of VRL plugin cannot be found on Linux
- Loading project payload plugins does not work since VRL 0.4.4.0.0
- This reference is not updated properly if visualization is overridden by new object HOT 2
- Is there any plan to build VRL and VRL-Studio on maven or gradle? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vrl.