// Copyright 2017 The go-interpreter Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package disasm

import (
	"io/ioutil"
	"log"
	"os"
)

var PrintDebugInfo = false

var logger *log.Logger

func init() {
	w := ioutil.Discard

	if PrintDebugInfo {
		w = os.Stderr
	}

	logger = log.New(w, "", log.Lshortfile)
	logger.SetFlags(log.Lshortfile)
}

// Copyright 2017 The go-interpreter Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package disasm

import (
	"io/ioutil"
	"log"
	"os"
)

var logger *log.Logger

func SetDebugMode(l bool) {
	w := ioutil.Discard

	if l {
		w = os.Stderr
	}

	logger = log.New(w, "", log.Lshortfile)
	logger.SetFlags(log.Lshortfile)

}

func init() {
	SetDebugMode(false)
}

Replace PrintDegbugInfo with function SetDebugMode.
disasm: Replace PrintDegbugInfo with function SetDebugMode.

SetDebugMode allows logging functionality to be enabled or disabled at
will.
