refactor: normalize log message grammar and capitalization (#89)

Problem: Log messages used inconsistent capitalization, punctuation,
and phrasing — some started lowercase, some omitted periods, "Pending"
was used instead of "task", and sync backend errors used ad-hoc
formatting.

Solution: Apply sentence case after backend prefixes, add trailing
periods to complete sentences, rename "Pending" to "task", use
`'Failed to <verb> <noun>: '` pattern for operation errors, and
pluralize "Archived N task(s)" correctly.
This commit is contained in:
Barrett Ruth 2026-03-06 18:38:17 -05:00
parent abf3e52277
commit 012bd9b043
5 changed files with 28 additions and 28 deletions

View file

@ -173,7 +173,7 @@ function M.push()
oauth.with_token(oauth.google_client, 'gcal', function(access_token)
local calendars, cal_err = get_all_calendars(access_token)
if cal_err or not calendars then
log.error(cal_err or 'failed to fetch calendars')
log.error(cal_err or 'Failed to fetch calendars.')
return
end
@ -199,7 +199,7 @@ function M.push()
local del_err =
delete_event(access_token, cal_id --[[@as string]], event_id --[[@as string]])
if del_err then
log.warn('gcal delete failed: ' .. del_err)
log.warn('Failed to delete calendar event: ' .. del_err)
failed = failed + 1
else
unlink_remote(task, extra, now_ts)
@ -217,7 +217,7 @@ function M.push()
if event_id and cal_id then
local upd_err = update_event(access_token, cal_id, event_id, task)
if upd_err then
log.warn('gcal update failed: ' .. upd_err)
log.warn('Failed to update calendar event: ' .. upd_err)
failed = failed + 1
else
updated = updated + 1
@ -225,12 +225,12 @@ function M.push()
else
local lid, lid_err = find_or_create_calendar(access_token, cat, calendars)
if lid_err or not lid then
log.warn('gcal calendar failed: ' .. (lid_err or 'unknown'))
log.warn('Failed to create calendar: ' .. (lid_err or 'unknown'))
failed = failed + 1
else
local new_id, create_err = create_event(access_token, lid, task)
if create_err then
log.warn('gcal create failed: ' .. create_err)
log.warn('Failed to create calendar event: ' .. create_err)
failed = failed + 1
elseif new_id then
if not task._extra then