Graphics Reference
In-Depth Information
7.4.3 Logging
This function takes over from where Simple Logging in chapter 5 ends. In large
compositions with complex interaction, logging is a very important tool to keep
an overview. Whereas the normal console.log() cannot be globally switched
on and of and also cannot group the output, Edge Commons makes both of
these functions possible. The following examples show an actual application.
// Simple logging
EC.info( "Logging with EdgeCommons is easy" );
// Different Log-Level
EC.info( "Message" );
EC.debug( "Message" );
EC.warn( "Message" );
EC.error( "Message" );
Besides the actual message, you can also define a group to make readability
and order of specific composition components easier:
// Logging groups (available for all levels)
EC.info( "Message", "GROUP NAME" );
EC.debug( "one message", "subpage portfolio" );
The Stage Timeline now looks like this:
[ INFO | GROUP NAME ] Message
[ DEBUG | subpage portfolio ] one message
A future version will also be able to filter specific groups. You can pass any
complex object as the third parameter, which will be clarified in the output. This
option also applies to all log levels:
EC.info( "Message", "GROUP", complexObject );
EC.debug("Current symbol: ", "TEST", sym);
 
Search WWH ::




Custom Search