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:
parent
b9b0b233d9
commit
dbf0ab1221
4 changed files with 44 additions and 44 deletions
|
|
@ -267,7 +267,7 @@ local function push_pass(access_token, tasklists, s, now_ts, by_gtasks_id)
|
|||
if allow_remote_delete() then
|
||||
local err = delete_gtask(access_token, list_id, gtid)
|
||||
if err then
|
||||
log.warn('Failed to delete remote task: ' .. err)
|
||||
log.warn('gtasks: failed to delete remote task — ' .. err)
|
||||
failed = failed + 1
|
||||
else
|
||||
unlink_remote(task, now_ts)
|
||||
|
|
@ -286,7 +286,7 @@ local function push_pass(access_token, tasklists, s, now_ts, by_gtasks_id)
|
|||
if not synced_at or task.modified > synced_at then
|
||||
local err = update_gtask(access_token, list_id, gtid, task_to_gtask(task))
|
||||
if err then
|
||||
log.warn('Failed to update remote task: ' .. err)
|
||||
log.warn('gtasks: failed to update remote task — ' .. err)
|
||||
failed = failed + 1
|
||||
else
|
||||
task._extra = task._extra or {}
|
||||
|
|
@ -300,7 +300,7 @@ local function push_pass(access_token, tasklists, s, now_ts, by_gtasks_id)
|
|||
if not err and lid then
|
||||
local new_id, create_err = create_gtask(access_token, lid, task_to_gtask(task))
|
||||
if create_err then
|
||||
log.warn('Failed to create remote task: ' .. create_err)
|
||||
log.warn('gtasks: failed to create remote task — ' .. create_err)
|
||||
failed = failed + 1
|
||||
elseif new_id then
|
||||
if not task._extra then
|
||||
|
|
@ -339,7 +339,7 @@ local function pull_pass(access_token, tasklists, s, now_ts, by_gtasks_id)
|
|||
for list_name, list_id in pairs(tasklists) do
|
||||
local items, err = list_gtasks(access_token, list_id)
|
||||
if err then
|
||||
log.warn('Failed to fetch task list "' .. list_name .. '": ' .. err)
|
||||
log.warn('gtasks: failed to fetch task list "' .. list_name .. '" — ' .. err)
|
||||
failed = failed + 1
|
||||
else
|
||||
fetched_list_ids[list_id] = true
|
||||
|
|
@ -414,7 +414,7 @@ end
|
|||
local function sync_setup(access_token)
|
||||
local tasklists, tl_err = get_all_tasklists(access_token)
|
||||
if tl_err or not tasklists then
|
||||
log.error(tl_err or 'Failed to fetch task lists.')
|
||||
log.error('gtasks: ' .. (tl_err or 'failed to fetch task lists'))
|
||||
return nil, nil, nil
|
||||
end
|
||||
local s = require('pending').store()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue