Method: Roby::Application#log_base_dir

Defined in:
lib/roby/app.rb

#log_base_dirObject

The base directory in which logs should be saved

Logs are saved in log_base_dir/$time_tag by default, and a log_base_dir/current symlink gets updated to reflect the most current log directory.

The path is controlled by the log/dir configuration variable. If the provided value, it is interpreted relative to the application directory. It defaults to “data”.



1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
# File 'lib/roby/app.rb', line 1525

def log_base_dir
    maybe_relative_dir =
        if @log_base_dir ||= log["dir"]
            @log_base_dir
        elsif (global_base_dir = ENV["ROBY_BASE_LOG_DIR"])
            if ENV["ROBY_ADD_APP_NAME_TO_BASE_LOG_DIR"] != "0"
                File.join(global_base_dir, app_name)
            else
                global_base_dir
            end
        else
            "logs"
        end
    File.expand_path(maybe_relative_dir, app_dir || Dir.pwd)
end