One thing we could do is come up with a REALLY trivial
API like TrLog.error(), TrLog.severe(), TrLog.warning(),
write one version that delegates to a quality JS logging
implementation and load that in the debug Trinidad JS,
and have the non-debug libraries contain just:

  TrLog.error = TrLog.severe = TrLog.warning = function() {}

We do have absolute control over what gets into non-debug
vs. debug via the ResourceLoader implementation, so this
sort of switching is easy.

If we wanted to be a bit more skimpy on codesize, we could also
store string constants on the non-debug TrLog, like:

TrLog.E0 = "Could not find element";

... and used as
  if (!element) { TrLog.error("E0", element); return; }

-- Adam



On 9/13/07, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> I can't say as I have used either, they just came up with some google
> searching. I definitely think some research is in order and hopefully
> some opinions from the community for any that people have used. I know
> that A4J uses some of them.
>
> Perhaps the suggestion for firebug lite may be good. It could be
> injected on an as-need basis, and therefore would be faster for users
> that already have firebug.
>
> Another sickening thought is to have Trinidad with its own logging
> solution, that delegates to something like firebug lite or log4js,
> etc. The script could be loaded only when needed. This could be
> possibly flagged in the web.xml as a context param (enabled javascript
> logging). If the script is not loaded, the Trinidad's API would simply
> be a black hole.
>
> Syntax could be something like:
> Log.<level>(<obj>)
>
> In this example, Log.error('hello world); would call <Log
> library>.<error log method>('hello world');
>
> If logging was turned off (default), Log.error() would have no method
> body. This way the extra javascript would simply be a few extra empty
> functions.
>
> Just a thought.
>
> -Andrew
>
>
> On 9/13/07, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
> > the sf.net project hasn't been touched since 17 month.
> > The berlin-os is shipping a larger file.
> >
> > Perhaps some more testing/evaluating needs to be done.
> >
> > -M
> >
> > On 9/13/07, Matthias Wessendorf <[EMAIL PROTECTED]> wrote:
> > > Hi Andrew,
> > >
> > > I think enhancing the logging in Trinidad's JS is valuable. Both have
> > > a very good license.
> > > The question is now, which is the "best" of the two ?
> > >
> > > Greetings,
> > > Matthias
> > >
> > > On 9/13/07, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > > > I put a comment on the bug to possibly enhance Trinidad's logging to
> > > > use log4js. There are two projects with that name, one at sourceforge
> > > > and one at berlios. I think either may be work looking at. They should
> > > > both work in any browser that I am aware of.
> > > >
> > > > What do you think Adam?
> > > > -Andrew
> > > >
> > > > On 9/13/07, Bertrand, Shawn R <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > The error dialog indeed doesn't appear in Firefox, though would it if
> > > > > Firebug wasn't installed?  There doesn't appear to be any sort of 
> > > > > error when
> > > > > running in Firefox – all I see in the Firebug console are POST 
> > > > > messages as
> > > > > expected.
> > > > >
> > > > >
> > > > >
> > > > > I haven't looked at the current 1.0.2 codebase, but does it contain 
> > > > > the
> > > > > change as outlined by Andrew for this?  I guess I'd like to update to 
> > > > > it if
> > > > > possible, because I can't see our users having to put up with 
> > > > > dismissing
> > > > > this error.
> > > > >
> > > > >
> > > > >
> > > > > Alternately, how might I go about finding the cause of the error 
> > > > > message in
> > > > > IE?
> > > > >
> > > > >
> > > > >
> > > > > Shawn
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >  ________________________________
> > > > >
> > > > >
> > > > > From: Adam Winer [mailto:[EMAIL PROTECTED]
> > > > >  Sent: Wednesday, September 12, 2007 2:08 PM
> > > > >  To: MyFaces Discussion
> > > > >  Subject: Re: [Trinidad] "console" is undefined?
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > This is indeed an attempt to call the firebug console (if
> > > > >
> > > > >
> > > > > it exists), and Andrew's totally right that the syntax here
> > > > >
> > > > >
> > > > > is wrong.  FWIW, this should only be called if an error
> > > > >
> > > > >
> > > > > has occurred, not in ordinary execution, so there's a more
> > > > >
> > > > >
> > > > > essential problem elsewhere.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > -- Adam
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 9/12/07, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Yes, I get this all of the time to. I believe console is the firebug
> > > > >  globally installed window variable (plug-in for firefox)
> > > > >
> > > > >  I think the following code may be more IE friendly:
> > > > >
> > > > >  if (window.console && window.console.error) {
> > > > >  ...
> > > > >  }
> > > > >
> > > > >  On 9/12/07, Bertrand, Shawn R
> > > > > <[EMAIL PROTECTED]> wrote:
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > I'm getting error generated from the first line of the following 
> > > > > function
> > > > > in
> > > > >  > Common1_0_2.js:
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > TrRequestQueue._logError=function(a118)
> > > > >  >
> > > > >  > {
> > > > >  >
> > > > >  > if(console&&console.error)
> > > > >  >
> > > > >  > console.error(arguments);
> > > > >  >
> > > > >  > }
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > This is running in IE 6.  Is this console object related to the 
> > > > > Acrobat
> > > > >  > console window?
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > Thanks,
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > Shawn
> > > > >  >
> > > > >  >
> > > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > >
> > > further stuff:
> > > blog: http://matthiaswessendorf.wordpress.com/
> > > mail: matzew-at-apache-dot-org
> > >
> >
> >
> > --
> > Matthias Wessendorf
> >
> > further stuff:
> > blog: http://matthiaswessendorf.wordpress.com/
> > mail: matzew-at-apache-dot-org
> >
>

Reply via email to