diff --git a/GetRuntimeAddresses/symbolyze/symbolyze.go b/GetRuntimeAddresses/symbolyze/symbolyze.go index c5ea3b3..4dc8afd 100644 --- a/GetRuntimeAddresses/symbolyze/symbolyze.go +++ b/GetRuntimeAddresses/symbolyze/symbolyze.go @@ -28,7 +28,7 @@ type Scanner struct { cache map[string]uint64 // Contains (pathname, offset) observers []Observer // Callbacks - *log.Logger // Embedded logger + logger // Embedded logger // Instead of using a boolean to indicate debugging, we use function // members. This way we can populate them with noop-functions in the @@ -39,6 +39,10 @@ type Scanner struct { err error // error state of the scanner. } +// We use a lowercase type alias for *log.Logger so that we can embedd it in +// Scanner without exporting it. +type logger = *log.Logger + // An Observer is a callback that can be registerd with Scanner.OnFound. It // will be called with a pid and an offset. Observers are called concurrently. // They have to be thread-safe. @@ -54,7 +58,7 @@ func New(symbol, pathglob string) *Scanner { pathglob: pathglob, cache: map[string]uint64{}, - Logger: log.New(os.Stderr, "[symbolyze] ", log.Ltime|log.Lmicroseconds), + logger: log.New(os.Stderr, "[symbolyze] ", log.Ltime|log.Lmicroseconds), // debugging is off per default. debugf: func(string, ...interface{}) {},