github.com/blend/go-sdk@v1.20240719.1/logger/stdlib_shim.go (about)

     1  /*
     2  
     3  Copyright (c) 2024 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package logger
     9  
    10  import (
    11  	stdlog "log"
    12  )
    13  
    14  // StdlibShim returns a stdlib logger that writes to a given logger instance.
    15  func StdlibShim(log Triggerable, opts ...ShimWriterOption) *stdlog.Logger {
    16  	shim := NewShimWriter(log)
    17  	for _, opt := range opts {
    18  		opt(&shim)
    19  	}
    20  	return stdlog.New(shim, "", 0)
    21  }