Loading ...
Sorry, an error occurred while loading the content.

Re: Logger: how to log objects ?

Expand Messages
  • jennykhan
    Hi Corentin, At this time, Logger always stringifies the messages sent to console.log(). Until this issue is resolved, you ll have to call
    Message 1 of 6 , Feb 29, 2008
    • 0 Attachment
      Hi Corentin,

      At this time, Logger always stringifies the messages sent to
      console.log(). Until this issue is resolved, you'll have to call
      console.log(myObject) directly in order to introspect objects via Firebug.

      Thanks,
      jenny





      --- In ydn-javascript@yahoogroups.com, "Corentin Merot" <cmerot@...>
      wrote:
      >
      > 2008/2/28, Adam Moore <adamoore@...>:
      > > On Thu, Feb 28, 2008 at 10:46:24AM -0000, corentin merot wrote:
      > > > I tried to log objects with the logger, and the output is quite
      > > > unreadable. So what I do is to set a global array `logs`, and then
      > > > use it to store objects I need to inspect with firebug or
      mozilla dom
      > > > inscpector: logs[logs.length] = myobject;
      > > >
      > > > Does the logger already implement that (am i missing something)? If
      > > > not, do you think that would be a nice feature?
      > >
      > > Co, try YAHOO.lang.dump:
      > >
      > > http://developer.yahoo.com/yui/docs/YAHOO.lang.html#dump
      > >
      > >
      > > -Adam
      > >
      > >
      >
      > Thanks for your answer Adam.
      >
      > It appears that it's what does the logger when logging objects, but
      > ouput is not as readable as firebug output.
      >
      > --
      > Co
      >
    • jennykhan
      Hi again, You can look for this to be fixed in the next release of Logger. In the meantime, here s the patch to YAHOO.widget.Logger._printToBrowserConsole:
      Message 2 of 6 , Feb 29, 2008
      • 0 Attachment
        Hi again,

        You can look for this to be fixed in the next release of Logger. In
        the meantime, here's the patch to
        YAHOO.widget.Logger._printToBrowserConsole:

        Instead of

        var output =
        localTime + " (" +
        elapsedTime + "ms): " +
        oEntry.source + ": " +
        oEntry.msg;

        console.log(output);


        use

        var output =
        localTime + " (" +
        elapsedTime + "ms): " +
        oEntry.source + ": ";

        console.log(output, oEntry.msg);

        Regards,
        Jenny




        --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...> wrote:
        >
        > Hi Corentin,
        >
        > At this time, Logger always stringifies the messages sent to
        > console.log(). Until this issue is resolved, you'll have to call
        > console.log(myObject) directly in order to introspect objects via
        Firebug.
        >
        > Thanks,
        > jenny
        >
        >
        >
        >
        >
        > --- In ydn-javascript@yahoogroups.com, "Corentin Merot" <cmerot@>
        > wrote:
        > >
        > > 2008/2/28, Adam Moore <adamoore@>:
        > > > On Thu, Feb 28, 2008 at 10:46:24AM -0000, corentin merot wrote:
        > > > > I tried to log objects with the logger, and the output is quite
        > > > > unreadable. So what I do is to set a global array `logs`,
        and then
        > > > > use it to store objects I need to inspect with firebug or
        > mozilla dom
        > > > > inscpector: logs[logs.length] = myobject;
        > > > >
        > > > > Does the logger already implement that (am i missing
        something)? If
        > > > > not, do you think that would be a nice feature?
        > > >
        > > > Co, try YAHOO.lang.dump:
        > > >
        > > > http://developer.yahoo.com/yui/docs/YAHOO.lang.html#dump
        > > >
        > > >
        > > > -Adam
        > > >
        > > >
        > >
        > > Thanks for your answer Adam.
        > >
        > > It appears that it's what does the logger when logging objects, but
        > > ouput is not as readable as firebug output.
        > >
        > > --
        > > Co
        > >
        >
      • Corentin Merot
        hi Jenny, I ve just apply the patch. That s what I was looking for. Thanks a lot! -- Co ... -- Corentin Merot http://themarqueeblink.com/ 06 33 16 67 96
        Message 3 of 6 , Mar 3, 2008
        • 0 Attachment
          hi Jenny,

          I've just apply the patch. That's what I was looking for. Thanks a lot!

          --
          Co


          2008/2/29, jennykhan <jennyhan@...>:

          Hi again,

          You can look for this to be fixed in the next release of Logger. In
          the meantime, here's the patch to
          YAHOO.widget.Logger._printToBrowserConsole:

          Instead of

          var output =
          localTime + " (" +
          elapsedTime + "ms): " +
          oEntry.source + ": " +
          oEntry.msg;

          console.log(output);

          use

          var output =
          localTime + " (" +
          elapsedTime + "ms): " +
          oEntry.source + ": ";

          console.log(output, oEntry.msg);

          Regards,
          Jenny



          --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...> wrote:
          >
          > Hi Corentin,
          >
          > At this time, Logger always stringifies the messages sent to
          > console.log(). Until this issue is resolved, you'll have to call
          > console.log(myObject) directly in order to introspect objects via
          Firebug.
          >
          > Thanks,
          > jenny
          >
          >
          >
          >
          >
          > --- In ydn-javascript@yahoogroups.com, "Corentin Merot" <cmerot@>
          > wrote:
          > >
          > > 2008/2/28, Adam Moore <adamoore@>:
          > > > On Thu, Feb 28, 2008 at 10:46:24AM -0000, corentin merot wrote:
          > > > > I tried to log objects with the logger, and the output is quite
          > > > > unreadable. So what I do is to set a global array `logs`,
          and then
          > > > > use it to store objects I need to inspect with firebug or
          > mozilla dom
          > > > > inscpector: logs[logs.length] = myobject;
          > > > >
          > > > > Does the logger already implement that (am i missing
          something)? If
          > > > > not, do you think that would be a nice feature?
          > > >
          > > > Co, try YAHOO.lang.dump:
          > > >
          > > > http://developer.yahoo.com/yui/docs/YAHOO.lang.html#dump
          > > >
          > > >
          > > > -Adam
          > > >
          > > >
          > >
          > > Thanks for your answer Adam.
          > >
          > > It appears that it's what does the logger when logging objects, but
          > > ouput is not as readable as firebug output.
          > >
          > > --
          > > Co
          > >
          >




          --
          Corentin Merot
          http://themarqueeblink.com/
          06 33 16 67 96
        Your message has been successfully submitted and would be delivered to recipients shortly.