1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-12 10:04:29 +02:00
opentelemetry-go/debug/doc.go
Aaron Clawson 8d0b098602 Creates a internal facing logging interface
This is a simple loggin interface to be used interally for the sdk.
Included is an exmaple in `namedtracer` run:
```
cd example/namedtracer
go run . >/dev/null
```
2021-11-12 15:23:18 +00:00

47 lines
1.3 KiB
Go

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Package debug provides methods to control internal logging of opentelemetry.
# Usage:
The default logger will discard all messages, to see the logs the application
developer needs to set a logger.
```
import (
"os"
"go.opentelemetry.io/otel/debug"
"github.com/go-logr/stdr"
)
func main() {
debug.SetLogger(
stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))
)
...
}
```
# Verbosity:
There are two different levels of logging currently the default (0) and
additional (5). To see the additional debug logs you need to configure your
logger to display the level 5 logs.
For example when using stdr use `stdr.SetVerbosity(5)` to see the aditional logs
*/
package debug // import "go.opentelemetry.io/otel/debug"