Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set logger for dedupe logging #306

Merged
merged 2 commits into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions system/modules/timelog/actions/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ function edit_POST(Web $w)
$timelogs_for_task_and_user[] = $existing_timelog;
}
}
LogService::getInstance($w)->info("DEVELOP CI/CD TIMELOG DEDUPE TEST LOG ### CURRENT ### ID $timelog->id - DT START " . substr($timelog->dt_start, 0, 10) . " " . substr($timelog->dt_start, 11, 5));
LogService::getInstance($w)->setLogger('DEDUPE')->info("DEVELOP CI/CD TIMELOG DEDUPE TEST LOG ### CURRENT ### ID $timelog->id - DT START " . substr($timelog->dt_start, 0, 10) . " " . substr($timelog->dt_start, 11, 5));
foreach ($timelogs_for_task_and_user as $existing_timelog_for_task_and_user) {
LogService::getInstance($w)->info("DEVELOP CI/CD TIMELOG DEDUPE TEST LOG ### EXISTING ### ID $existing_timelog_for_task_and_user->id - DT START " . gmdate('Y-m-d', strtotime($existing_timelog_for_task_and_user->getDateStart() . ' ' . $existing_timelog_for_task_and_user->getTimeStart())) . " " . gmdate('H:i', strtotime($existing_timelog_for_task_and_user->getTimeStart())));
LogService::getInstance($w)->setLogger('DEDUPE')->info("DEVELOP CI/CD TIMELOG DEDUPE TEST LOG ### EXISTING ### ID $existing_timelog_for_task_and_user->id - DT START " . gmdate('Y-m-d', strtotime($existing_timelog_for_task_and_user->getDateStart() . ' ' . $existing_timelog_for_task_and_user->getTimeStart())) . " " . gmdate('H:i', strtotime($existing_timelog_for_task_and_user->getTimeStart())));

if (gmdate('Y-m-d', strtotime($existing_timelog_for_task_and_user->getDateStart() . ' ' . $existing_timelog_for_task_and_user->getTimeStart())) == substr($timelog->dt_start, 0, 10) && gmdate('H:i', strtotime($existing_timelog_for_task_and_user->getTimeStart())) == substr($timelog->dt_start, 11, 5)) {
$w->error('Duplicate Timelog Removed', $redirect ?: '/timelog');
Expand Down
Loading