fix(sync): add backend name prefix to all OAuth log messages (#122)

* fix(sync): add backend name prefix to all OAuth log messages (#121)

Problem: four log messages in `oauth.lua` lacked the `self.name` backend
prefix, producing generic notifications instead of identifying which
backend (`gcal`/`gtasks`) triggered the message.

Solution: prepend `self.name .. ': '` to the four unprefixed messages
and drop the hardcoded "Google" from the browser prompt since `self.name`
already identifies the service.

* fix(sync): canonicalize all log prefixes across sync backends (#121)

Problem: log messages in `oauth.lua`, `gcal.lua`, `gtasks.lua`, and
`s3.lua` were inconsistent — some lacked a backend prefix, others used
sentence-case or bare error strings without identifying the source.

Solution: prefix all user-facing log messages with their backend name
(`gcal:`, `gtasks:`, `S3:`, `Google:`). Capitalize `S3` and `Google`
display names. Normalize casing and separator style (em dash) across
all sync log sites.
This commit is contained in:
Barrett Ruth 2026-03-10 11:26:16 -04:00 committed by GitHub
parent 1eb2e49096
commit 914633235a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 44 deletions

View file

@ -159,7 +159,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('gcal: ' .. (cal_err or 'failed to fetch calendars'))
return
end
@ -185,7 +185,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('Failed to delete calendar event: ' .. del_err)
log.warn('gcal: failed to delete calendar event — ' .. del_err)
failed = failed + 1
else
unlink_remote(task, extra, now_ts)
@ -203,7 +203,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('Failed to update calendar event: ' .. upd_err)
log.warn('gcal: failed to update calendar event — ' .. upd_err)
failed = failed + 1
else
updated = updated + 1
@ -211,12 +211,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('Failed to create calendar: ' .. (lid_err or 'unknown'))
log.warn('gcal: 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('Failed to create calendar event: ' .. create_err)
log.warn('gcal: failed to create calendar event — ' .. create_err)
failed = failed + 1
elseif new_id then
if not task._extra then