dclDebug.log()
Version 1.x
The main method of this module logs on console debugging details about an object. Provided details includes an ordered list of dependencies, super calls, and both class-level and object-level AOP advises.
Description
Working with non-trivial inheritance chains can be puzzling. While the C3 MRO algorithm
used by dcl
takes care of duplicates and ordering of mixins, in some cases programmer
needs to know exact details of such linearization.
Even more puzzling can be ordering of call chains, and/or advices both static and dynamic.
dclDebug.log()
provides both types of information, and inspects what constructor was used
to create an object.
Examples
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 27 |
|
The snippet above will produce a following output on console:
1 2 3 4 5 6 7 |
|
Notes
- It is always a good idea to specify a property called
declaredClass
, which can be any readable text used to identify your “class” definition. It is used bydclDebug
facilities to provide a human-readable information. Common convention is to specify a name to reflect its logical “path”, like “dcl/debug” or “dcl/debug/CycleError”.