What you are asking can only be achieved if the logging function is synchronous 
(something not advisable in node).

So as long as the code is sync like:

        function log(txt) { fs.writeFileSync(…..); }

You will be able to do:

        …..
        log('foo');
        bar(); //this will execute after log finished.

Cheers,

Gustavo Machado
[email protected]



On Mar 5, 2013, at 8:14 AM, Siva Pratap Palakurthi <[email protected]> wrote:

> Hi all,
> I wanted to write a logging utility in node.js app. So i will call a function 
> multiple times in code, and the code after the call should run only after 
> that logging utility gets executed. I know this can be easily done with 
> callbacks. But i dont want to use callbacks here. I should just need to call 
> a function. Thanks, in advance.
> 
> -- 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to