Sha256: 59e4055c1104adac65854059593a855291d85fdf7c5c05eed102a38a23cb0fe3

Contents?: true

Size: 893 Bytes

Versions: 6

Compression:

Stored size: 893 Bytes

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

module GoodData
  # Simple file logger.
  class BrickFileLogger
    # entry-point
    # @param [String] log_directory directory to create log files
    # @param [String] mode - brick mode (short name if brick)
    def initialize(log_directory, mode)
      @log_directory = log_directory
      @mode = mode
    end

    # Creates file in log directory with given content. Logging is disabled when log_directory is nil.
    #
    # @param [String] status brick phase/status (start, finished, error,...)
    # @param [String] content log file content
    def log_action(status, content)
      File.write("#{@log_directory}/#{@mode}_#{status}.json", content)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gooddata-1.3.3-java lib/gooddata/lcm/brick_logger.rb
gooddata-1.3.3 lib/gooddata/lcm/brick_logger.rb
gooddata-1.3.2-java lib/gooddata/lcm/brick_logger.rb
gooddata-1.3.2 lib/gooddata/lcm/brick_logger.rb
gooddata-1.3.1-java lib/gooddata/lcm/brick_logger.rb
gooddata-1.3.1 lib/gooddata/lcm/brick_logger.rb