rclone/vendor/storj.io/drpc/drpcdebug/log_enabled.go

19 lines
319 B
Go
Raw Normal View History

2020-05-11 20:57:46 +02:00
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
// +build debug
package drpcdebug
import (
"log"
"os"
)
var logger = log.New(os.Stderr, "", 0)
// Log executes the callback for a string to log if built with the debug tag.
func Log(cb func() string) {
logger.Output(2, "\t"+cb())
}