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:
parent
abf3e52277
commit
012bd9b043
5 changed files with 28 additions and 28 deletions
|
|
@ -281,7 +281,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('gtasks delete failed: ' .. err)
|
||||
log.warn('Failed to delete remote task: ' .. err)
|
||||
failed = failed + 1
|
||||
else
|
||||
unlink_remote(task, now_ts)
|
||||
|
|
@ -300,7 +300,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('gtasks update failed: ' .. err)
|
||||
log.warn('Failed to update remote task: ' .. err)
|
||||
failed = failed + 1
|
||||
else
|
||||
task._extra = task._extra or {}
|
||||
|
|
@ -314,7 +314,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('gtasks create failed: ' .. create_err)
|
||||
log.warn('Failed to create remote task: ' .. create_err)
|
||||
failed = failed + 1
|
||||
elseif new_id then
|
||||
if not task._extra then
|
||||
|
|
@ -353,7 +353,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('error fetching list ' .. list_name .. ': ' .. err)
|
||||
log.warn('Failed to fetch task list "' .. list_name .. '": ' .. err)
|
||||
failed = failed + 1
|
||||
else
|
||||
fetched_list_ids[list_id] = true
|
||||
|
|
@ -428,7 +428,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(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