 fs     = require 'fs'
 path   = require 'path'
 
+console.debug = console.log if process.env.yang_debug?
+
 YANG_SPEC_SCHEMA = yaml.Schema.create [
 
   new yaml.Type '!require',
     kind: 'scalar'
     resolve:   (data) -> typeof data is 'string'
     construct: (data) ->
-      console.log "processing !require using: #{data}"
+      console.debug? "processing !require using: #{data}"
       require data
       #require (path.resolve pkgdir, data)
 

            delete extension[ext]
          map.define 'extension', name, extension
        delete schema.extension
        console.log "[preprocess:#{map.name}] found #{extensions.length} new extension(s)"
        continue

      ext = map.resolve 'extension', key

            when typeof arg is 'string' and arg.length > 50
              ((arg.replace /\s\s+/g, ' ').slice 0, 50) + '...'
            else arg
          console.debug? "[preprocess:#{map.name}] #{key} #{argument} " + if params? then "{ #{Object.keys params} }" else ''
          params ?= {}
          @preprocess params, map, ext
          try
