Skip to content

Instantly share code, notes, and snippets.

@s992
Created April 22, 2013 02:03
Show Gist options
  • Save s992/5431987 to your computer and use it in GitHub Desktop.
Save s992/5431987 to your computer and use it in GitHub Desktop.
<cfscript>
string = "I'm a string!";
numeric = 12345;
boolean = true;
chromelogger.log( string, numeric, boolean );
</cfscript>
<cfscript>
string = "I'm a string!";
numeric = 12345;
boolean = true;
chromelogger.log( string );
chromelogger.log( numeric );
chromelogger.log( boolean );
</cfscript>
<cfscript>
warn = "I'm a warning!";
error = "I'm an error!";
chromelogger.warn( warn );
chromelogger.error( error );
</cfscript>
<cfscript>
chromelogger.group( "This is my group label." );
chromelogger.log( "Just a normal log..." );
chromelogger.warn( "Uh-oh.." );
chromelogger.error( "We broke something!" );
chromelogger.groupEnd();
</cfscript>
<cfscript>
user = new User();
address = new Address();
chromelogger.group( "Populating a user record..." );
user.setID( 123 );
user.setName( "Sean" );
// Let's try to set a non-existent property and then log the error.
try {
user.setAge( 26 );
} catch( Any e ) {
chromelogger.error( "Uh-oh! We caught an error:" );
chromelogger.log( e );
}
address.setID( 456 );
address.setStreet( "Test St." );
// How does it work with some recursion?
user.setAddress( address );
address.setUser( user );
// Just fine!
chromelogger.log( user );
chromelogger.groupEnd();
</cfscript>
<cfscript>
query = new com.adobe.coldfusion.query();
query.setDatasource( "cfartgallery" );
query.setSQL( "SELECT * FROM artists" );
query = query.execute().getResult();
chromelogger.log( query );
struct = {
"key" = "value"
, "array" = [
"let's", "try", "a", "nested", "array"
]
};
chromelogger.log( struct );
array = [
1, 2, 3, 4, 5, { "nested" = "structs too?" }
];
chromelogger.log( array );
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment