Blame docs/trace.md

Packit bfcc33
## This is proposed interface in https://github.com/sass/libsass/pull/1288
Packit bfcc33
Packit bfcc33
Additional debugging macros with low overhead are available, `TRACE()` and `TRACEINST()`.
Packit bfcc33
Packit bfcc33
Both macros simulate a string stream, so they can be used like this:
Packit bfcc33
Packit bfcc33
    TRACE() << "Reached.";
Packit bfcc33
Packit bfcc33
produces:
Packit bfcc33
Packit bfcc33
    [LibSass] parse_value parser.cpp:1384 Reached.
Packit bfcc33
Packit bfcc33
`TRACE()`
Packit bfcc33
   logs function name, source filename, source file name to the standard error and the attached
Packit bfcc33
   stream to the standard error.
Packit bfcc33
Packit bfcc33
`TRACEINST(obj)`
Packit bfcc33
   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:
Packit bfcc33
Packit bfcc33
    TRACEINST(this) << "String_Constant created " << this;
Packit bfcc33
Packit bfcc33
produces:
Packit bfcc33
Packit bfcc33
    [LibSass] 0x8031ba980:String_Constant ./ast.hpp:1371 String_Constant created (0,"auto")
Packit bfcc33
Packit bfcc33
The macros generate output only of `LibSass_TRACE` is set in the environment.