FromContext returns a span logger using the current parent span. If there is no parent span, the SpanLogger will only log to the logger in the context. If the context doesn't have a logger, the global logger is used.
(ctx context.Context)
| 59 | // in the context. If the context doesn't have a logger, the global logger |
| 60 | // is used. |
| 61 | func FromContext(ctx context.Context) *SpanLogger { |
| 62 | return FromContextWithFallback(ctx, util_log.Logger) |
| 63 | } |
| 64 | |
| 65 | // FromContextWithFallback returns a span logger using the current parent span. |
| 66 | // IF there is no parent span, the SpanLogger will only log to the logger |