Sha256: 727384341fb249c3ce6bf307f2afd872ed95af4fab6b3b18901230b373fb8d29

Contents?: true

Size: 863 Bytes

Versions: 52

Compression:

Stored size: 863 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] log_file - file to log
    def initialize(log_directory, log_file)
      @log_directory = log_directory
      @log_file = log_file
    end

    # Creates file in log directory with given content. Logging is disabled when log_directory is nil.
    #
    # @param [String] content log file content
    def log_action(content)
      FileUtils.mkpath @log_directory
      File.open("#{@log_directory}/#{@log_file}", 'a') { |file| file.write(content + "\n") }
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.3.1 lib/gooddata/lcm/brick_logger.rb
gooddata-2.3.0-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.3.0 lib/gooddata/lcm/brick_logger.rb
gooddata-2.2.0-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.2.0 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.19-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.19 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.17-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.17 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.15-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.15 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.14-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.14 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.13-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.13 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.12-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.12 lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.11-java lib/gooddata/lcm/brick_logger.rb
gooddata-2.1.11 lib/gooddata/lcm/brick_logger.rb