Merge pull request #17283 from dundargoc/ci/reduce-log-output

ci: only show last 100 lines of log on error
This commit is contained in:
James McCoy 2022-02-03 17:11:18 -05:00 committed by GitHub
commit b667bb355d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -815,7 +815,7 @@ end
function module.read_nvim_log(logfile, ci_rename) function module.read_nvim_log(logfile, ci_rename)
logfile = logfile or os.getenv('NVIM_LOG_FILE') or '.nvimlog' logfile = logfile or os.getenv('NVIM_LOG_FILE') or '.nvimlog'
local is_ci = module.isCI() local is_ci = module.isCI()
local keep = is_ci and 999 or 10 local keep = is_ci and 100 or 10
local lines = module.read_file_list(logfile, -keep) or {} local lines = module.read_file_list(logfile, -keep) or {}
local log = (('-'):rep(78)..'\n' local log = (('-'):rep(78)..'\n'
..string.format('$NVIM_LOG_FILE: %s\n', logfile) ..string.format('$NVIM_LOG_FILE: %s\n', logfile)