ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* log reporting?
@ 2013-05-02 15:30 Meer, H. van der
  2013-05-02 17:00 ` Sietse Brouwer
  0 siblings, 1 reply; 3+ messages in thread
From: Meer, H. van der @ 2013-05-02 15:30 UTC (permalink / raw)
  To: NTG ConTeXt

How do I enable the output of for example:
    report_typescripts("unknown library %a or %a",name_one,name_two)
defined by
local report_typescripts = logs.reporter("fonts","typescripts")

Hans van der Meer



___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: log reporting?
  2013-05-02 15:30 log reporting? Meer, H. van der
@ 2013-05-02 17:00 ` Sietse Brouwer
  2013-05-08  9:03   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Sietse Brouwer @ 2013-05-02 17:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans,

> How do I enable the output of for example:
>     report_typescripts("unknown library %a or %a",name_one,name_two)

`logs.reporter("fonts","typescripts")` returns a function for writing
to the log. Calling that function produces this sort of output:

fonts      > typescripts > bla bla bla

Sometimes calls to a reporter are wrapped in a 'only if tracker x is
active'. This is not the case with this reporter, though. If this
reporter is not printing anything, it's because the error condition is
not arising, not because you didn't activate some tracker.

For completeness: the wiki has more on trackers, including a list of them.
http://wiki.contextgarden.net/Trackers

And this is what a reporter wrapped in a tracker looks like:

    -- defining the tracker
    local trace_casing = false
    trackers.register("typesetters.casing", function(v) trace_casing = v end)

    -- checking whether the tracker is active
    if trace_casing then
        report_casing("case trigger %a, instance %a, result
%a",attr%100,div(attr,100),ok)
    end

Hope this helps,
Sietse
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: log reporting?
  2013-05-02 17:00 ` Sietse Brouwer
@ 2013-05-08  9:03   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2013-05-08  9:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5/2/2013 7:00 PM, Sietse Brouwer wrote:
> Hi Hans,
>
>> How do I enable the output of for example:
>>      report_typescripts("unknown library %a or %a",name_one,name_two)
>
> `logs.reporter("fonts","typescripts")` returns a function for writing
> to the log. Calling that function produces this sort of output:
>
> fonts      > typescripts > bla bla bla
>
> Sometimes calls to a reporter are wrapped in a 'only if tracker x is
> active'. This is not the case with this reporter, though. If this
> reporter is not printing anything, it's because the error condition is
> not arising, not because you didn't activate some tracker.
>
> For completeness: the wiki has more on trackers, including a list of them.
> http://wiki.contextgarden.net/Trackers

context --trackers
context --directives
context --experiments

> And this is what a reporter wrapped in a tracker looks like:
>
>      -- defining the tracker
>      local trace_casing = false
>      trackers.register("typesetters.casing", function(v) trace_casing = v end)
>
>      -- checking whether the tracker is active
>      if trace_casing then
>          report_casing("case trigger %a, instance %a, result
> %a",attr%100,div(attr,100),ok)
>      end

Klopt. En verschillende modules kunnen dezelfde tracker gebruiken (een 
ietwat complex onderliggend mechanisms zorgt er voor dat alles wordt 
gesynchroniseerd).

Men kan ook in texsmfcnf.lua dingen instellen (trackers, directives, 
experiments). Men kan die dingen op verschillende momenten instellen:

- commandline
- environment
- cnf file
- tex/lua file

in volgorde van prioriteit.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-08  9:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02 15:30 log reporting? Meer, H. van der
2013-05-02 17:00 ` Sietse Brouwer
2013-05-08  9:03   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).