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

Removing YAHOO.log "debug" statements from application production code

Expand Messages
  • Ted Husted
    I ve been hanging around long enough now that I think I know what the answer is going to be, but, hey, hope springs eternal. :) I ve started to use the
    Message 1 of 3 , Mar 30, 2007
    • 0 Attachment
      I've been hanging around long enough now that I think I know what the
      answer is going to be, but, hey, hope springs eternal. :)

      I've started to use the LogReader today, and, of course, like all
      things YUI, it's brilliant.

      It's also very cool that the YUI distribution includes the "debug"
      source with the logging statements, the standard script without
      logging statements, and the minimized code too. I now understand what
      the empty else statements are about :)

      Is there a handy tool or some clever way to exclude the log statements
      from our own production code?

      Are there any other useful techniques being used in the "debug"
      versions of the scripts, aside from the log statements?

      A blog about the YUI build system might be helpful to a lot of people.

      TIA, Ted.
      <http://husted.com/ted/blog/>
    • Mike Lee (YUI)
      Hi Ted, Hmm, that s a good idea! As for handy tools, I don t know of any that are out there in the wild. Most that I ve encountered seem to be home-grown.
      Message 2 of 3 , Mar 30, 2007
      • 0 Attachment
        Hi Ted,

        Hmm, that's a good idea!

        As for handy tools, I don't know of any that are out there in the wild.
        Most that I've encountered seem to be home-grown. There are a few
        minification & compression tools out there, like JSMin[1] and
        ShrinkSafe[2]. You can also take a peek at jQuery's build process[3] and
        Makefile[4] for some ideas.

        I hope this helps!


        [1] Douglas Crockford's JSMin:
        http://javascript.crockford.com/jsmin.html
        [2] Dojo's ShrinkSafe: http://dojotoolkit.org/docs/shrinksafe
        [3] jQuery:
        http://docs.jquery.com/Downloading_jQuery#Subversion_.28SVN.29
        [4] jQuery's Makefile:
        http://dev.jquery.com/browser/trunk/jquery/Makefile


        ________________________________

        From: ydn-javascript@yahoogroups.com
        [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Ted Husted
        Sent: Friday, March 30, 2007 12:34 PM
        To: ydn-javascript@yahoogroups.com
        Subject: [ydn-javascript] Removing YAHOO.log "debug" statements from
        application production code


        I've been hanging around long enough now that I think I know what the
        answer is going to be, but, hey, hope springs eternal. :)

        I've started to use the LogReader today, and, of course, like all
        things YUI, it's brilliant.

        It's also very cool that the YUI distribution includes the "debug"
        source with the logging statements, the standard script without
        logging statements, and the minimized code too. I now understand what
        the empty else statements are about :)

        Is there a handy tool or some clever way to exclude the log statements
        from our own production code?

        Are there any other useful techniques being used in the "debug"
        versions of the scripts, aside from the log statements?

        A blog about the YUI build system might be helpful to a lot of people.

        TIA, Ted.
        <http://husted.com/ted/blog/ <http://husted.com/ted/blog/> >
      • Satyen Desai
        Hi Ted, We currently use an automated ANT based process to create the normal, debug and min versions of the deployed production files which also runs them
        Message 3 of 3 , Apr 4, 2007
        • 0 Attachment
          Hi Ted,

          We currently use an automated ANT based process to create the normal,
          debug and min versions of the deployed production files which also
          runs them through JSLint.

          We're in the process of refining this process though (so that we don't
          have things like the empty else statements you mention below), and
          we'd be happy to share it as soon as it's mature enough to add value
          to the community.

          Regards,
          Satyen

          --- In ydn-javascript@yahoogroups.com, "Ted Husted" <groups@...> wrote:
          >
          > I've been hanging around long enough now that I think I know what the
          > answer is going to be, but, hey, hope springs eternal. :)
          >
          > I've started to use the LogReader today, and, of course, like all
          > things YUI, it's brilliant.
          >
          > It's also very cool that the YUI distribution includes the "debug"
          > source with the logging statements, the standard script without
          > logging statements, and the minimized code too. I now understand what
          > the empty else statements are about :)
          >
          > Is there a handy tool or some clever way to exclude the log statements
          > from our own production code?
          >
          > Are there any other useful techniques being used in the "debug"
          > versions of the scripts, aside from the log statements?
          >
          > A blog about the YUI build system might be helpful to a lot of people.
          >
          > TIA, Ted.
          > <http://husted.com/ted/blog/>
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.