[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-devel
Subject:    Re: [ jEdit-devel ] Plugin status output
From:       Alan Ezust <alan.ezust () gmail ! com>
Date:       2019-10-17 20:00:34
Message-ID: CALy5K9oNDGf8KeKaxastrmGZoz+Y0eS-yJHTEccM+LDZTrifYg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


That particular log message is from the class DockableWindowManagerImpl.
and if you search that class for occurrence of "Unknown dockable" in the
log message, you'll find where it was printed from.



On Thu, Oct 17, 2019 at 12:27 PM Adam Pease <apease@articulatesoftware.com>
wrote:

> Hi Dale,
>    I use that technique myself fairly often, but in this case, the
> challenge is to know where in the code to put a printout or throw an
> exception, since the error reported in the activity log doesn't specify
> a location in the code where the error occurred.
>    Or is there something I'm missing?
>
> all the best,
> Adam
>
> On 10/17/19 12:18 PM, Dale Anson wrote:
> > The simplest java debugger:
> >
> > new Exception().printStackTrace();
> >
> > You can put this anywhere in your java code and see just how you got
> > there. Very simple and very effective.
> >
> > On Thu, Oct 17, 2019 at 7:51 AM Adam Pease
> > <apease@articulatesoftware.com <mailto:apease@articulatesoftware.com>>
> > wrote:
> >
> >     Hi Dale and All,
> >          Using the Log class worked, with log level of MESSAGE.  Using
> log
> >     level of DEBUG didn't result in printing to STDOUT.
> >          I've succeeded at getting my syntax checker function to report
> >     errors to ErrorList.  Now it's just about details :-)
> >          One strange thing that happened is that all my jEdit menus are
> now
> >     special characters like the enclosed screenshot of the Activity Log
> >     (I'll send this separately since the list appears to block images).
> Do
> >     you know what might cause that?
> >          Another challenge results from my trying to delete features
> >     from the
> >     QuickNotepad plugin that aren't part of my system and rename the
> >     classes.  This has resulted in the Activity Log message
> >
> >     11:14:36 AM [AWT-EventQueue-0] [error] DockableWindowManagerImpl:
> >     Unknown dockable window: SUMOjEdit
> >
> >     But the message is not as helpful as a Java error since it doesn't
> >     mention from what file or line of code it comes from.  Do you have
> any
> >     thoughts on debugging messages of this sort?
> >
> >     all the best,
> >     Adam
> >
> >     On 10/15/19 5:57 PM, Adam Pease wrote:
> >      > Hi Dale,
> >      >     Many thanks for the quick response!  For some reason I don't
> see
> >      > System.out messages in the Activity log.  I'm starting jEdit from
> the
> >      > command line and don't see them there either.  I'll try the Log
> >     class.
> >      >     I'm afraid Antlr and others would be "underkill" for my
> >     application
> >      > since it's not just syntax checking (although I figured it was
> >     easier to
> >      > call it that at first, but now since you've brought it up... :-)
> but
> >      > rather complex things like type inference in a higher-order
> >     mathematical
> >      > logic.
> >      >
> >      > all the best,
> >      > Adam
> >      >
> >      >
> >      > On 10/15/19 5:40 PM, Dale Anson wrote:
> >      >> System.out and/or System.err should work fine, those messages
> should
> >      >> show up in the Activity log. If you start jEdit from a command
> line,
> >      >> System.out and System.err should also show there. Another
> (perhaps
> >      >> better) option is to use jEdit's Log class, org.gjt.sp.util.Log,
> >     you can
> >      >> find the API details in jEdit's help. Basic usage is something
> >     like this:
> >      >>
> >      >> import org.gjt.sp.util.Log;
> >      >> ...
> >      >> Log.log(Log.DEBUG,this,"some important message");
> >      >>
> >      >> The "this" can really be anything, it takes an Object, so it
> >     could be a
> >      >> String or the class you're calling it from, or whatever is
> >     useful for you.
> >      >>
> >      >> How are you writing your syntax checking plugin? I've used both
> >     javacc
> >      >> and Antlr quite a bit for such things, both have a bit of a
> learning
> >      >> curve, but work very well. You can look at the source for
> Beauty,
> >      >> JavaSideKick, and XML plugins for examples of both. On the other
> >     hand,
> >      >> that could be overkill for what you're trying to do.
> >      >>
> >      >> Dale
> >      >>
> >      >>
> >      >>
> >      >> On Tue, Oct 15, 2019 at 4:21 PM Adam Pease
> >      >> <apease@articulatesoftware.com
> >     <mailto:apease@articulatesoftware.com>
> >     <mailto:apease@articulatesoftware.com
> >     <mailto:apease@articulatesoftware.com>>>
> >      >> wrote:
> >      >>
> >      >>      Hi All,
> >      >>          I'm attempting to write a syntax checking plugin in
> >     jEdit for a
> >      >>      language I've created.  Thanks to help from Dale Anson and
> the
> >      >>      QuickNotepad plugin tutorial, I have a basic plugin that
> >     loads code
> >      >>      from
> >      >>      my existing framework (on GitHub at
> >     https://github.com/ontologyportal
> >      >>      and the plugin is SUMOjEdit).  I've started working with
> >     the ErrorList
> >      >>      plugin as part of this effort. But I've reached an impasse
> >     where the
> >      >>      first feature I want to implement doesn't work and I need
> >     to figure out
> >      >>      how to generate some status messages that would help me to
> >     debug it.
> >      >>          I can create the ErrorList and see a placeholder sort
> >     of error
> >      >>      that I
> >      >>      create in my QuickNotepad.checkErrors() method (if anyone
> >     wants to look
> >      >>      at the code).
> >      >>          I can look at the Troubleshooting->ActivityLog and see
> >     all the
> >      >>      messages my framework writes to System.out when
> >     initializing, called
> >      >>      from the QuickNotepad constructor.  However, if I put some
> >     simple
> >      >>      System.out.println() messages into the plugin action of
> >      >>      QuickNotepad.checkErrors() they don't appear.  I've also
> >     tried writing
> >      >>      to the status bar, following the advice at
> >      >> http://community.jedit.org/?q=node/view/3977 without success.
> >      >>          Can anyone point me to an approach that would allow me
> >     to display
> >      >>      status messages from my plugin during its execution?
> >      >>
> >      >>      all the best,
> >      >>      Adam
> >      >>
> >      >>      --
> >      >>      --------
> >      >>      Adam Pease
> >      >> http://www.ontologyportal.org
> >      >> http://www.adampease.org
> >      >>      @apease_ontology on Twitter
> >      >>
> >      >>      --
> >      >>      -----------------------------------------------
> >      >>      jEdit Developers' List
> >      >> jEdit-devel@lists.sourceforge.net
> >     <mailto:jEdit-devel@lists.sourceforge.net>
> >      >>      <mailto:jEdit-devel@lists.sourceforge.net
> >     <mailto:jEdit-devel@lists.sourceforge.net>>
> >      >> https://lists.sourceforge.net/lists/listinfo/jedit-devel
> >      >>
> >      >
> >
> >     --
> >     --------
> >     Adam Pease
> >     http://www.ontologyportal.org
> >     http://www.adampease.org
> >     @apease_ontology on Twitter
> >
> >
> >     --
> >     -----------------------------------------------
> >     jEdit Developers' List
> >     jEdit-devel@lists.sourceforge.net
> >     <mailto:jEdit-devel@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/jedit-devel
> >
>
> --
> --------
> Adam Pease
> http://www.ontologyportal.org
> http://www.adampease.org
> @apease_ontology on Twitter
>
> --
> -----------------------------------------------
> jEdit Developers' List
> jEdit-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jedit-devel
>

[Attachment #5 (text/html)]

<div dir="ltr"><div><br></div><div>That particular log message is from the class \
DockableWindowManagerImpl.</div><div>and if you search that class for occurrence of \
&quot;Unknown dockable&quot; in the log message, you&#39;ll find where it was printed \
from.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Thu, Oct 17, 2019 at 12:27 PM Adam Pease &lt;<a \
href="mailto:apease@articulatesoftware.com">apease@articulatesoftware.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Dale,<br>  I use \
that technique myself fairly often, but in this case, the <br> challenge is to know \
where in the code to put a printout or throw an <br> exception, since the error \
reported in the activity log doesn&#39;t specify <br> a location in the code where \
the error occurred.<br>  Or is there something I&#39;m missing?<br>
<br>
all the best,<br>
Adam<br>
<br>
On 10/17/19 12:18 PM, Dale Anson wrote:<br>
&gt; The simplest java debugger:<br>
&gt; <br>
&gt; new Exception().printStackTrace();<br>
&gt; <br>
&gt; You can put this anywhere in your java code and see just how you got <br>
&gt; there. Very simple and very effective.<br>
&gt; <br>
&gt; On Thu, Oct 17, 2019 at 7:51 AM Adam Pease <br>
&gt; &lt;<a href="mailto:apease@articulatesoftware.com" \
target="_blank">apease@articulatesoftware.com</a> &lt;mailto:<a \
href="mailto:apease@articulatesoftware.com" \
target="_blank">apease@articulatesoftware.com</a>&gt;&gt; <br> &gt; wrote:<br>
&gt; <br>
&gt;        Hi Dale and All,<br>
&gt;               Using the Log class worked, with log level of MESSAGE.   Using \
log<br> &gt;        level of DEBUG didn&#39;t result in printing to STDOUT.<br>
&gt;               I&#39;ve succeeded at getting my syntax checker function to \
report<br> &gt;        errors to ErrorList.   Now it&#39;s just about details :-)<br>
&gt;               One strange thing that happened is that all my jEdit menus are \
now<br> &gt;        special characters like the enclosed screenshot of the Activity \
Log<br> &gt;        (I&#39;ll send this separately since the list appears to block \
images).   Do<br> &gt;        you know what might cause that?<br>
&gt;               Another challenge results from my trying to delete features<br>
&gt;        from the<br>
&gt;        QuickNotepad plugin that aren&#39;t part of my system and rename the<br>
&gt;        classes.   This has resulted in the Activity Log message<br>
&gt; <br>
&gt;        11:14:36 AM [AWT-EventQueue-0] [error] DockableWindowManagerImpl:<br>
&gt;        Unknown dockable window: SUMOjEdit<br>
&gt; <br>
&gt;        But the message is not as helpful as a Java error since it \
doesn&#39;t<br> &gt;        mention from what file or line of code it comes from.   \
Do you have any<br> &gt;        thoughts on debugging messages of this sort?<br>
&gt; <br>
&gt;        all the best,<br>
&gt;        Adam<br>
&gt; <br>
&gt;        On 10/15/19 5:57 PM, Adam Pease wrote:<br>
&gt;         &gt; Hi Dale,<br>
&gt;         &gt;        Many thanks for the quick response!   For some reason I \
don&#39;t see<br> &gt;         &gt; System.out messages in the Activity log.   \
I&#39;m starting jEdit from the<br> &gt;         &gt; command line and don&#39;t see \
them there either.   I&#39;ll try the Log<br> &gt;        class.<br>
&gt;         &gt;        I&#39;m afraid Antlr and others would be \
&quot;underkill&quot; for my<br> &gt;        application<br>
&gt;         &gt; since it&#39;s not just syntax checking (although I figured it \
was<br> &gt;        easier to<br>
&gt;         &gt; call it that at first, but now since you&#39;ve brought it up... \
:-) but<br> &gt;         &gt; rather complex things like type inference in a \
higher-order<br> &gt;        mathematical<br>
&gt;         &gt; logic.<br>
&gt;         &gt;<br>
&gt;         &gt; all the best,<br>
&gt;         &gt; Adam<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; On 10/15/19 5:40 PM, Dale Anson wrote:<br>
&gt;         &gt;&gt; System.out and/or System.err should work fine, those messages \
should<br> &gt;         &gt;&gt; show up in the Activity log. If you start jEdit from \
a command line,<br> &gt;         &gt;&gt; System.out and System.err should also show \
there. Another (perhaps<br> &gt;         &gt;&gt; better) option is to use \
jEdit&#39;s Log class, org.gjt.sp.util.Log,<br> &gt;        you can<br>
&gt;         &gt;&gt; find the API details in jEdit&#39;s help. Basic usage is \
something<br> &gt;        like this:<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; import org.gjt.sp.util.Log;<br>
&gt;         &gt;&gt; ...<br>
&gt;         &gt;&gt; Log.log(Log.DEBUG,this,&quot;some important message&quot;);<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; The &quot;this&quot; can really be anything, it takes an \
Object, so it<br> &gt;        could be a<br>
&gt;         &gt;&gt; String or the class you&#39;re calling it from, or whatever \
is<br> &gt;        useful for you.<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; How are you writing your syntax checking plugin? I&#39;ve used \
both<br> &gt;        javacc<br>
&gt;         &gt;&gt; and Antlr quite a bit for such things, both have a bit of a \
learning<br> &gt;         &gt;&gt; curve, but work very well. You can look at the \
source for   Beauty,<br> &gt;         &gt;&gt; JavaSideKick, and XML plugins for \
examples of both. On the other<br> &gt;        hand,<br>
&gt;         &gt;&gt; that could be overkill for what you&#39;re trying to do.<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; Dale<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; On Tue, Oct 15, 2019 at 4:21 PM Adam Pease<br>
&gt;         &gt;&gt; &lt;<a href="mailto:apease@articulatesoftware.com" \
target="_blank">apease@articulatesoftware.com</a><br> &gt;        &lt;mailto:<a \
href="mailto:apease@articulatesoftware.com" \
target="_blank">apease@articulatesoftware.com</a>&gt;<br> &gt;        &lt;mailto:<a \
href="mailto:apease@articulatesoftware.com" \
target="_blank">apease@articulatesoftware.com</a><br> &gt;        &lt;mailto:<a \
href="mailto:apease@articulatesoftware.com" \
target="_blank">apease@articulatesoftware.com</a>&gt;&gt;&gt;<br> &gt;         \
&gt;&gt; wrote:<br> &gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         Hi All,<br>
&gt;         &gt;&gt;                I&#39;m attempting to write a syntax checking \
plugin in<br> &gt;        jEdit for a<br>
&gt;         &gt;&gt;         language I&#39;ve created.   Thanks to help from Dale \
Anson and the<br> &gt;         &gt;&gt;         QuickNotepad plugin tutorial, I have \
a basic plugin that<br> &gt;        loads code<br>
&gt;         &gt;&gt;         from<br>
&gt;         &gt;&gt;         my existing framework (on GitHub at<br>
&gt;        <a href="https://github.com/ontologyportal" rel="noreferrer" \
target="_blank">https://github.com/ontologyportal</a><br> &gt;         &gt;&gt;       \
and the plugin is SUMOjEdit).   I&#39;ve started working with<br> &gt;        the \
ErrorList<br> &gt;         &gt;&gt;         plugin as part of this effort. But \
I&#39;ve reached an impasse<br> &gt;        where the<br>
&gt;         &gt;&gt;         first feature I want to implement doesn&#39;t work and \
I need<br> &gt;        to figure out<br>
&gt;         &gt;&gt;         how to generate some status messages that would help me \
to<br> &gt;        debug it.<br>
&gt;         &gt;&gt;                I can create the ErrorList and see a placeholder \
sort<br> &gt;        of error<br>
&gt;         &gt;&gt;         that I<br>
&gt;         &gt;&gt;         create in my QuickNotepad.checkErrors() method (if \
anyone<br> &gt;        wants to look<br>
&gt;         &gt;&gt;         at the code).<br>
&gt;         &gt;&gt;                I can look at the \
Troubleshooting-&gt;ActivityLog and see<br> &gt;        all the<br>
&gt;         &gt;&gt;         messages my framework writes to System.out when<br>
&gt;        initializing, called<br>
&gt;         &gt;&gt;         from the QuickNotepad constructor.   However, if I put \
some<br> &gt;        simple<br>
&gt;         &gt;&gt;         System.out.println() messages into the plugin action \
of<br> &gt;         &gt;&gt;         QuickNotepad.checkErrors() they don&#39;t \
appear.   I&#39;ve also<br> &gt;        tried writing<br>
&gt;         &gt;&gt;         to the status bar, following the advice at<br>
&gt;         &gt;&gt; <a href="http://community.jedit.org/?q=node/view/3977" \
rel="noreferrer" target="_blank">http://community.jedit.org/?q=node/view/3977</a> \
without success.<br> &gt;         &gt;&gt;                Can anyone point me to an \
approach that would allow me<br> &gt;        to display<br>
&gt;         &gt;&gt;         status messages from my plugin during its \
execution?<br> &gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         all the best,<br>
&gt;         &gt;&gt;         Adam<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         --<br>
&gt;         &gt;&gt;         --------<br>
&gt;         &gt;&gt;         Adam Pease<br>
&gt;         &gt;&gt; <a href="http://www.ontologyportal.org" rel="noreferrer" \
target="_blank">http://www.ontologyportal.org</a><br> &gt;         &gt;&gt; <a \
href="http://www.adampease.org" rel="noreferrer" \
target="_blank">http://www.adampease.org</a><br> &gt;         &gt;&gt;         \
@apease_ontology on Twitter<br> &gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         --<br>
&gt;         &gt;&gt;         -----------------------------------------------<br>
&gt;         &gt;&gt;         jEdit Developers&#39; List<br>
&gt;         &gt;&gt; <a href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a><br> &gt;        &lt;mailto:<a \
href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a>&gt;<br> &gt;         &gt;&gt;   \
&lt;mailto:<a href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a><br> &gt;        &lt;mailto:<a \
href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a>&gt;&gt;<br> &gt;         \
&gt;&gt; <a href="https://lists.sourceforge.net/lists/listinfo/jedit-devel" \
rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/jedit-devel</a><br>
 &gt;         &gt;&gt;<br>
&gt;         &gt;<br>
&gt; <br>
&gt;        -- <br>
&gt;        --------<br>
&gt;        Adam Pease<br>
&gt;        <a href="http://www.ontologyportal.org" rel="noreferrer" \
target="_blank">http://www.ontologyportal.org</a><br> &gt;        <a \
href="http://www.adampease.org" rel="noreferrer" \
target="_blank">http://www.adampease.org</a><br> &gt;        @apease_ontology on \
Twitter<br> &gt; <br>
&gt; <br>
&gt;        -- <br>
&gt;        -----------------------------------------------<br>
&gt;        jEdit Developers&#39; List<br>
&gt;        <a href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a><br> &gt;        &lt;mailto:<a \
href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a>&gt;<br> &gt;        <a \
href="https://lists.sourceforge.net/lists/listinfo/jedit-devel" rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/jedit-devel</a><br> &gt; \
<br> <br>
-- <br>
--------<br>
Adam Pease<br>
<a href="http://www.ontologyportal.org" rel="noreferrer" \
target="_blank">http://www.ontologyportal.org</a><br> <a \
href="http://www.adampease.org" rel="noreferrer" \
target="_blank">http://www.adampease.org</a><br> @apease_ontology on Twitter<br>
<br>
-- <br>
-----------------------------------------------<br>
jEdit Developers&#39; List<br>
<a href="mailto:jEdit-devel@lists.sourceforge.net" \
target="_blank">jEdit-devel@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/jedit-devel" rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/jedit-devel</a><br> \
</blockquote></div>





-- 
-----------------------------------------------
jEdit Developers' List
jEdit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic