Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
global scoping
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tony Zakula  
View profile  
 More options Oct 12 2010, 5:26 pm
From: Tony Zakula <tonyzak...@gmail.com>
Date: Tue, 12 Oct 2010 16:26:31 -0500
Local: Tues, Oct 12 2010 5:26 pm
Subject: global scoping

If you have the following in application.sjs

    onApplicationStart:function(){ // run if application cache has expired

 $application.set("appEngine",Myna.include($application.directory+"appEngine /appEngine.sjs",{}));

 $application.set("appLog",Myna.include($application.directory+"appEngine/ap pLogging.sjs",{}));
    },
    onRequestStart:function(){ // run directly before requested file
      var appEngine = $application.get("appEngine");
      var log = $application.get("appLog");
      $req.handled = appEngine.handleRequest();
    },

Should you be able to call log.mymethod() from inside an appEngine function?
 I keep getting an undefined error.

Thanks,

Tony


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Porter  
View profile  
 More options Oct 12 2010, 8:29 pm
From: Mark Porter <m...@porterpeople.com>
Date: Tue, 12 Oct 2010 18:29:05 -0600
Local: Tues, Oct 12 2010 8:29 pm
Subject: Re: [mynajs-general] global scoping

The problem is using "var" inside of onRequestStart. That binds to the
function scope. You want to either leave it un-var'd or explicitly bind it
to the global scope: $server.globalScope.log = $application...

On an unrelated note, why are you not using Myna.log() for logging?
On Oct 12, 2010 3:26 PM, "Tony Zakula" <tonyzak...@gmail.com> wrote:

> If you have the following in application.sjs

> onApplicationStart:function(){ // run if application cache has expired

$application.set("appEngine",Myna.include($application.directory+"appEngine /appEngine.sjs",{}));

$application.set("appLog",Myna.include($application.directory+"appEngine/ap pLogging.sjs",{}));

"MynaJS-General" group.
> To post to this group, send email to mynajs-general@googlegroups.com.
> To unsubscribe from this group, send email to

mynajs-general+unsubscribe@googlegroups.com<mynajs-general%2Bunsubscribe@go oglegroups.com>
.
> For more options, visit this group at

http://groups.google.com/group/mynajs-general?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Zakula  
View profile  
 More options Oct 12 2010, 8:52 pm
From: Tony Zakula <tonyzak...@gmail.com>
Date: Tue, 12 Oct 2010 19:52:49 -0500
Local: Tues, Oct 12 2010 8:52 pm
Subject: Re: [mynajs-general] global scoping

Ha,  Thanks.  I will get the hang of JavaScript pretty soon I promise!  :-)

I am using Myna.log inside of my logging function.  I basically wanted to
wrap some functions around Myna logging to make it a little more like apache
logger.

For example, you can use if(log.isInfoEnabled()) log.log("myMessage");

Then inside of log.log, I am using Myna.Log.

I have info, debug, none right now.  If you wrap your logging with those
statements, then you can control the logging level app wide with a setting.
 Just seems more efficient and makes for easier trouble shooting down the
road.

Tony Z


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »