# Object3D log function

**URL:** <https://discourse.threejs.org/t/object3d-log-function/109>\
**Category:** Resources\
**Tags:** debugging, code-snippet, utility-function\
**Created:** [March 22, 2017, 2:32pm UTC](https://discourse.threejs.org/t/object3d-log-function/109 "2017-03-22T14:32:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [March 22, 2017, 2:32pm UTC](https://discourse.threejs.org/t/object3d-log-function/109/1 "2017-03-22T14:32:05Z")

</div>

It was recently decided [not to include logging functions in the core library](https://github.com/mrdoob/three.js/pull/10995).

However it’s useful functionality so here is a copy of the proposed log function (author: @WestLangley).

```auto
function log( object3D ) {

    object3D .traverse( function ( obj ) {

        var s = '|___';
	
        var obj2 = obj;

	while ( obj2.parent !== null ) {

	    s = '\t' + s;

	    obj2 = obj2.parent;

	}

	console.log( s + obj.name + ' <' + obj.type + '>' );

    } );

},

```
