Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package logexporters |
||
2 | |||
3 | import ( |
||
4 | "fmt" |
||
5 | |||
6 | "github.com/agoda-com/opentelemetry-logs-go/exporters/otlp/otlplogs" |
||
7 | ) |
||
8 | |||
9 | // ExporterFactory - Create log exporter according to given params |
||
10 | func ExporterFactory(name, endpoint string, insecure bool, urlpath string, headers map[string]string) (*otlplogs.Exporter, error) { |
||
11 | switch name { |
||
12 | case "otlp", "otlp-http": |
||
13 | return NewOTLP(endpoint, insecure, urlpath, headers) |
||
14 | case "otlp-grpc": |
||
15 | return nil, fmt.Errorf("%s log exporter is unsupported", name) |
||
16 | default: |
||
17 | return nil, fmt.Errorf("%s log exporter is unsupported", name) |
||
18 | } |
||
20 |