File: trace.md

package info (click to toggle)
golang-github-bep-golibsass 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,808 kB
  • sloc: cpp: 30,398; ansic: 848; sh: 662; makefile: 340; perl: 56
file content (26 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## This is proposed interface in https://github.com/sass/libsass/pull/1288

Additional debugging macros with low overhead are available, `TRACE()` and `TRACEINST()`.

Both macros simulate a string stream, so they can be used like this:

    TRACE() << "Reached.";

produces:

    [LibSass] parse_value parser.cpp:1384 Reached.

`TRACE()`
   logs function name, source filename, source file name to the standard error and the attached
   stream to the standard error.

`TRACEINST(obj)`
   logs object instance address, function name, source filename, source file name to the standard error and the attached stream to the standard error, for example:

    TRACEINST(this) << "String_Constant created " << this;

produces:

    [LibSass] 0x8031ba980:String_Constant ./ast.hpp:1371 String_Constant created (0,"auto")

The macros generate output only of `LibSass_TRACE` is set in the environment.