Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.12 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.12 KB

PSR Tracing

This repository holds all interfaces/classes/traits related to PSR-22.

Note that this is not a logger of its own. It is merely an interface that describes a tracer. See the specification for more details.

More information

Installation

composer require psr/tracing

Usage

function imgResize($size=100) {
    $span = $this->tracer->startSpan('image.resize')
        ->setAttribute('size',$size)
        ->activate();    

    try{
    
      //Resize the image
      return $resizedImage;
    
    } catch (Exception $e) {
        // Ideally, you would attach the exception to the span here
        $span->setStatus(SpanInterface::STATUS_ERROR)
             ->addException($e);
    } finally {
        $span->finish();
    }    
}