Sha256: b737f58c18d986a25a4495a67813cfacf8c5e77ceb2d3d8258f583c38e7dd6cc

Contents?: true

Size: 1023 Bytes

Versions: 2

Compression:

Stored size: 1023 Bytes

Contents

# frozen_string_literal: true

require 'toolrack'
require 'teLogger'

require 'tty/command'
require 'tty/which'

require_relative "dockerun/version"
require_relative 'dockerun/dsl'

require_relative 'dockerun/cli_engine'

module Dockerun
  include TR::CondUtils

  class Error < StandardError; end
  class InsufficientParameter < StandardError; end
  # Your code goes here...

  def self.logger(tag = nil, &block)
    if @_logger.nil?
      drLogout = ENV["DR_LOGOUT"]
      if is_empty?(drLogout)
        @_logger = TeLogger::Tlogger.new('dockerun.log',5, 5*1024*1024)
      else
        @_logger = TeLogger::Tlogger.new(drLogout, 5, 5*1024*1024)
      end
    end

    if block
      if not_empty?(tag)
        @_logger.with_tag(tag, &block)
      else
        @_logger.with_tag(@_logger.tag, &block)
      end
    else
      if is_empty?(tag)
        @_logger.tag = :dockerun
        @_logger
      else
        # no block but tag is given? hmm
        @_logger.tag = tag
        @_logger
      end
    end
  end



end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dockerun-0.4.2 lib/dockerun.rb
dockerun-0.4.1 lib/dockerun.rb