Tracking calling tag

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Tracking calling tag

Göran Törnquist-2
Hi,
is there a way to find out which tag (or which
tag and custom type) called a certain tag?
Something like [params_up] but providing with
details for the caller.

Hypothetical use would be something along:

Define_Tag('A');
   MyLog('something to log');
/Define_Tag;

Define_Tag('MyLog', -required='text');
   log_detail('Called by ' + caller_up);  //here is the hypothetical use
   log_detail('Params: ' + params_up);
/Define_Tag;


/Göran
--
-----------------
Göran Törnquist
Stockby Hantverksby 4
181 75 Lidingö

0733-86 04 70

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Jolle Carlestam
Since you have to call MyLog with params anyway why not send another  
param with it?

Define_Tag('A');
   MyLog('something to log', -origin='A');
/Define_Tag;

Define_Tag('MyLog', -required='text');
   log_detail('Called by ' + #origin);
   log_detail('Params: ' + params_up);
/Define_Tag;


HDB
JC

5 jul 2007 kl. 13.06 skrev Göran Törnquist:

> Hi,
> is there a way to find out which tag (or which tag and custom type)  
> called a certain tag? Something like [params_up] but providing with  
> details for the caller.
>
> Hypothetical use would be something along:
>
> Define_Tag('A');
>   MyLog('something to log');
> /Define_Tag;
>
> Define_Tag('MyLog', -required='text');
>   log_detail('Called by ' + caller_up);  //here is the hypothetical  
> use
>   log_detail('Params: ' + params_up);
> /Define_Tag;
>
>
> /Göran
> --
> -----------------
> Göran Törnquist
> Stockby Hantverksby 4
> 181 75 Lidingö
>
> 0733-86 04 70
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Göran Törnquist-2
For the plain reason less to to code at every
point where the routine should be used. More code
and more params to send leads to more prone to
errors.

I am implementing a logging routine which takes
configuration from a site wide configuration
object. The routine is planned to have support
for logging certain object types and certain
virtual file paths.

/Göran

>Since you have to call MyLog with params anyway
>why not send another param with it?
>
>Define_Tag('A');
>   MyLog('something to log', -origin='A');
>/Define_Tag;
>
>Define_Tag('MyLog', -required='text');
>   log_detail('Called by ' + #origin);
>   log_detail('Params: ' + params_up);
>/Define_Tag;
>
>
>HDB
>JC
>
>5 jul 2007 kl. 13.06 skrev Göran Törnquist:
>
>>Hi,
>>is there a way to find out which tag (or which
>>tag and custom type) called a certain tag?
>>Something like [params_up] but providing with
>>details for the caller.
>>
>>Hypothetical use would be something along:
>>
>>Define_Tag('A');
>>   MyLog('something to log');
>>/Define_Tag;
>>
>>Define_Tag('MyLog', -required='text');
>>   log_detail('Called by ' + caller_up);  //here is the hypothetical use
>>   log_detail('Params: ' + params_up);
>>/Define_Tag;
>>
>>
>>/Göran
>>--
>>-----------------
>>Göran Törnquist
>>Stockby Hantverksby 4
>>181 75 Lidingö
>>
>>0733-86 04 70
>>
>>--
>>This message has been scanned for viruses and
>>dangerous content by MailScanner, and is
>>believed to be clean.
>>
>>
>>--
>>This list is a free service of LassoSoft: http://www.LassoSoft.com/
>>Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>>Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>
>
>--
>This list is a free service of LassoSoft: http://www.LassoSoft.com/
>Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>Manage your subscription: http://www.ListSearch.com/Lasso/
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.


--
-----------------
Göran Törnquist
Stockby Hantverksby 4
181 75 Lidingö

0733-86 04 70

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Bil Corry-3
Göran Törnquist wrote on 7/5/2007 5:51 AM:
> For the plain reason less to to code at every point where the routine
> should be used. More code and more params to send leads to more prone to
> errors.

You could do it this way, to avoid sending params, and every ctag would contain the exact same code to avoid errors:


define_tag:'TagChain',-priority='replace',-required='tagname';
  if: !(global_defined:'_tagchain');
    global:'_tagchain' = (array: #tagname);
  else;
    $_tagchain->(insert: #tagname);
  /if;
/define_tag;

Define_Tag('A');
  tagchain: tag_name;
  MyLog('something to log');
/Define_Tag;

Define_Tag('B');
  tagchain: tag_name;
  MyLog('something else to log');
/Define_Tag;

Define_Tag('MyLog', -required='text');
  content_body += #text + ' -- called by ' + $_tagchain->last;
/Define_Tag;

a;
b;




- Bil



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Greg Willits-2
In reply to this post by Göran Törnquist-2
On Jul 5, 2007, at 4:06 AM, Göran Törnquist wrote:

> is there a way to find out which tag (or which tag and custom type)  
> called a certain tag? Something like [params_up] but providing with  
> details for the caller.


I have a very well tuned set of tools for this:

http://www.ldml.org/library/fwpDebugUtils.lasso


-- gw
-----------------------------------------------------------------------
www.araelium.com/aredit/ae_and_lasso :: A new, Lasso-friendly, OS X
specific project manager and code editing development application.
www.pageblocks.org :: A comprehensive application framework for Lasso.
-----------------------------------------------------------------------



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Göran Törnquist-2
In reply to this post by Bil Corry-3
Thanks Bil!
However it doesn't really help me all the way
since I'd like to also access the ctype in the
same manner as the ctag name.

I do understand that the example below can be
extended to allow for this as well, but I'm still
having my hopes up for any (previously)
undocumented tag. Obviously, there is some kind
of support for that since LassoStudio for Eclipse
can handle that.

/Göran

>Göran Törnquist wrote on 7/5/2007 5:51 AM:
>>For the plain reason less to to code at every
>>point where the routine should be used. More
>>code and more params to send leads to more
>>prone to errors.
>
>You could do it this way, to avoid sending
>params, and every ctag would contain the exact
>same code to avoid errors:
>
>
>define_tag:'TagChain',-priority='replace',-required='tagname';
>  if: !(global_defined:'_tagchain');
>    global:'_tagchain' = (array: #tagname);
>  else;
>    $_tagchain->(insert: #tagname);
>  /if;
>/define_tag;
>
>Define_Tag('A');
>  tagchain: tag_name;
>  MyLog('something to log');
>/Define_Tag;
>
>Define_Tag('B');
>  tagchain: tag_name;
>  MyLog('something else to log');
>/Define_Tag;
>
>Define_Tag('MyLog', -required='text');
>  content_body += #text + ' -- called by ' + $_tagchain->last; /Define_Tag;
>a;
>b;
>
>
>
>
>- Bil
>
>
>
>--
>This list is a free service of LassoSoft: http://www.LassoSoft.com/
>Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>Manage your subscription: http://www.ListSearch.com/Lasso/
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.


--
-----------------
Göran Törnquist
Stockby Hantverksby 4
181 75 Lidingö

0733-86 04 70

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Göran Törnquist-2
In reply to this post by Greg Willits-2
Thanks Greg,
I'll look into the docs to see if I can use them
as is or to use as inspiration for my needs.

/Göran

>On Jul 5, 2007, at 4:06 AM, Göran Törnquist wrote:
>
>>is there a way to find out which tag (or which
>>tag and custom type) called a certain tag?
>>Something like [params_up] but providing with
>>details for the caller.
>
>
>I have a very well tuned set of tools for this:
>
>http://www.ldml.org/library/fwpDebugUtils.lasso
>
>
>-- gw
>-----------------------------------------------------------------------
>www.araelium.com/aredit/ae_and_lasso :: A new, Lasso-friendly, OS X
>specific project manager and code editing development application.
>www.pageblocks.org :: A comprehensive application framework for Lasso.
>-----------------------------------------------------------------------
>
>
>
>--
>This list is a free service of LassoSoft: http://www.LassoSoft.com/
>Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>Manage your subscription: http://www.ListSearch.com/Lasso/
>
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.


--
-----------------
Göran Törnquist
Stockby Hantverksby 4
181 75 Lidingö

0733-86 04 70

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Bil Corry-3
In reply to this post by Göran Törnquist-2
Göran Törnquist wrote on 7/5/2007 10:44 AM:
> I do understand that the example below can be extended to allow for this
> as well, but I'm still having my hopes up for any (previously)
> undocumented tag. Obviously, there is some kind of support for that
> since LassoStudio for Eclipse can handle that.

It would be handy.  BTW, here's the ctypes as well:


define_tag:'TagChain',-priority='replace',-required='tagname';
 if: !(global_defined:'_tagchain');
   global:'_tagchain' = (array: #tagname);
 else;
   $_tagchain->(insert: #tagname);
 /if;
/define_tag;

Define_Tag('A');
 tagchain: tag_name;
 MyLog('something to log');
/Define_Tag;

Define_Tag('B');
 tagchain: tag_name;
 MyLog('something else to log');
/Define_Tag;

Define_Type('CType');
Define_Tag('C');
 tagchain: tag_name;
 MyLog('something more to log');
/Define_Tag;
/Define_Type;

Define_Type('DType');
local:'tag_name' = tag_name;
Define_Tag('D');
 tagchain: self->tag_name + ':' + tag_name;
 MyLog('something more to log');
/Define_Tag;
/Define_Type;

Define_Tag('MyLog', -required='text');
 content_body += #text + ' -- called by ' + $_tagchain->last + '<br>';
/Define_Tag;

a;
b;
ctype->c;
dtype->d;


- Bil



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: Tracking calling tag

Greg Willits-2
In reply to this post by Göran Törnquist-2
>>> is there a way to find out which tag (or which tag and custom  
>>> type) called a certain tag? Something like [params_up] but  
>>> providing with details for the caller.
>>
>>
>> I have a very well tuned set of tools for this:
>> http://www.ldml.org/library/fwpDebugUtils.lasso

> Thanks Greg,
> I'll look into the docs to see if I can use them as is or to use as  
> inspiration for my needs.


If you find there's some capability you think it should have, let me  
know.

I have made some minor improvements to the versions currently  
embedded in PB, but I can update the ones on ldml.org if needed.

-- gw



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/