title: Common wrapper in Jenkinsfile
body: <p>I want to add <code>timestamps()</code> and <code>colorizeOutput()</code> features to our pipeline <a href="https://jenkins.io/doc/book/pipeline/shared-libraries/" rel="nofollow noreferrer">libraries</a>. I find the <code>wrappers {}</code> in Jenkins <a href="https://jenkinsci.github.io/job-dsl-plugin/#method/javaposse.jobdsl.dsl.jobs.IvyJob.wrappers" rel="nofollow noreferrer">documentation</a>:</p>
  
  <pre><code>job('example') {
      wrappers {
          colorizeOutput()
          timestamps()
      }
  }
  </code></pre>
  
  <p>I don`t get how to add wrappers to out library which looks like that:</p>
  
  <pre><code>// file ..src/helpers/Builder.groovy
  
  package helpers.sw_main
  
  def doSomething() {
      // some Groovy stuff here
  }
  
  def doSomethingElse() {
      // do something else
  }
  </code></pre>
  
  <p>Our job pipeline looks like that:</p>
  
  <pre><code>#!/usr/bin/env groovy
  
  // this is our library with custom methods
  @Library('ext-lib')
  def builder = new helpers.Builder()
  
  node {
      try {
  
          stage('Some Stage') {
              builder.doSomething()
          }
      }
  
      catch (err) {
          throw err
      }
  }
  </code></pre>
  
  <p>So, I want to add timestamps and ansi-colors to every function from library. Of course, I can do it with wrapping every function with </p>
  
  <pre><code>timestamps() {
      colorizeOutput() {
          // function body
      }
  }
  </code></pre>
  
  <p>But its a little stupid. </p>
  
  <p>So can I easily wrap pipeline or library?</p>