mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-11 09:17:06 +00:00
Merge branch 'add-log-accessor' of https://github.com/carolynvs/yq into carolynvs-add-log-accessor
This commit is contained in:
commit
5447826e72
@ -15,6 +15,11 @@ import (
|
|||||||
|
|
||||||
var log = logging.MustGetLogger("yq-lib")
|
var log = logging.MustGetLogger("yq-lib")
|
||||||
|
|
||||||
|
// GetLogger returns the yq logger instance.
|
||||||
|
func GetLogger() *logging.Logger {
|
||||||
|
return log
|
||||||
|
}
|
||||||
|
|
||||||
type operationType struct {
|
type operationType struct {
|
||||||
Type string
|
Type string
|
||||||
NumArgs uint // number of arguments to the op
|
NumArgs uint // number of arguments to the op
|
||||||
|
|||||||
10
pkg/yqlib/lib_test.go
Normal file
10
pkg/yqlib/lib_test.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package yqlib
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestGetLogger(t *testing.T) {
|
||||||
|
l := GetLogger()
|
||||||
|
if l != log {
|
||||||
|
t.Fatal("GetLogger should return the yq logger instance, not a copy")
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user