[ 7 posts ]

Peter Foti

  • Username: Fotiman
  • Joined: Thu Sep 17, 2009 10:09 am
  • Posts: 128
  • Offline
  • Profile

Problem with logger

Post Posted: Tue Nov 09, 2010 7:53 am
+0-
Code:
var yuiloader = new window.YAHOO.util.YUILoader();
       
            // Load YUI in a sandboxed environment.
            yuiloader.sandbox({
                require: ['animation',
                        'connection',
                        'container',
                        'cookie',
                        'dom',
                        'dragdrop',
                        'element',
                        'event',
                        'json',
                        'logger',
                        'yahoo'],

When the builder runs the -loggerregex target, it destroys that bit of code. And I end up with:
Code:
var yuiloader = new window.YAHOO.util.YUILoader();
       
            // Load YUI in a sandboxed environment.
            yuiloader.sandbox({
                require: ['animation',
                        'connection',
                        'container',
                        'cookie',
                        'dom',
                        'dragdrop',
                        'element',
                        'event',
                        'json',


What am I doing wrong?

Peter Foti

  • Username: Fotiman
  • Joined: Thu Sep 17, 2009 10:09 am
  • Posts: 128
  • Offline
  • Profile
Tags:

Re: Problem with logger

Post Posted: Tue Nov 09, 2010 1:26 pm
+0-
And actually, I think it's a little harsher than my example shows because it deletes everything up to the next semicolon. Since this is in an Object Literal, there is more stuff defined after the require property.

Peter Foti

  • Username: Fotiman
  • Joined: Thu Sep 17, 2009 10:09 am
  • Posts: 128
  • Offline
  • Profile
Tags:

Re: Problem with logger

Post Posted: Tue Nov 09, 2010 1:55 pm
+0-
I can obviously skip the loggerregex step by setting component.logger.regex.skip=true in the build.properties file. I'm hoping to find some explanation, though, about how to implement logger but still strip it out in the production version.

Alex Kaye

  • Username: NoxDeleo
  • Joined: Fri Dec 04, 2009 5:01 am
  • Posts: 5
  • Offline
  • Profile

Re: Problem with logger

Post Posted: Tue Dec 07, 2010 2:23 am
+0-
This problem hit me today as well...lots of hair pulling until I realized the builder was stripping it. I suppose one way would be to load it through an alias in the YUI statement...I'm not somewhere I can test this at the moment, but theoretically something like this might work (as a workaround):

Code:
YUI({
    modules: {
        myLogger:
        {
            fullpath: 'path/to/logger'
        }
    }
}).use(..., function(Y)
{

});


...and then "require" myLogger in your code. Sorry this is set out for YUI 3...I never got that far into YUI 2 before I was sucked into 3's awesome modularity :D. Its a horrible workaround, but hopefully that helps somehow.

Audrey Howe

  • Username: Audreyhowe200
  • Joined: Thu Jun 02, 2011 2:42 am
  • Posts: 1
  • IRC: audreyhowe200
  • Offline
  • Profile

Re: Problem with logger

Post Posted: Thu Jun 02, 2011 2:48 am
+0-
I am having the same problem with my logger? any help would be greatly appreciated !!

Bob C. Davis

  • Username: bobdavis118
  • Joined: Wed Sep 21, 2011 6:44 am
  • Posts: 1
  • GitHub: bobdavis118
  • Gists: bobdavis118
  • IRC: bobdavis118
  • Offline
  • Profile
Tags:

Re: Problem with logger

Post Posted: Wed Sep 21, 2011 7:02 am
+0-
Same thing anyone know the answer?

Walter Rumsby

YUI Contributor

  • Username: wrumsby
  • Joined: Tue Feb 10, 2009 1:11 pm
  • Posts: 18
  • Location: Auckland, New Zealand
  • Twitter: wrumsby
  • GitHub: wrumsby
  • Gists: wrumsby
  • Offline
  • Profile
Tags:

Re: Problem with logger

Post Posted: Sun Apr 22, 2012 2:56 pm
+0-
Considering switching the regex to:

Code:
"^\s*(YAHOO.log|Y.log|console.log)\s*?\(.*\);\r?\n"


this is safer, but assumes statements are on separate lines, which isn't always the case.
  [ 7 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum