Skip to content

Commit 2d5f865

Browse files
committed
use logging
1 parent dabd04e commit 2d5f865

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

app/Services/PredefinedFilterPermissionService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Exception;
66
use App\Models\PredefinedFilterPermission;
77
use Illuminate\Support\Facades\Auth;
8+
use Log;
89

910
class PredefinedFilterPermissionService
1011
{
@@ -17,7 +18,7 @@ public function store(array $validated): PredefinedFilterPermission
1718
$permission->permission_group_id = $validated['permission_group_id'];
1819
$permission->created_by = $userId;
1920
if (!$permission->save()) {
20-
throw new Exception($permission->getErrors());
21+
Log::error($permission->getErrors());
2122
}
2223

2324
return $permission;

database/seeders/PredefinedFilterPermissionSeeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use App\Models\User;
1111
use Illuminate\Contracts\Auth\Guard;
1212
use Illuminate\Support\Facades\Hash;
13+
use Log;
1314

1415
class PredefinedFilterPermissionSeeder extends Seeder
1516
{
@@ -53,8 +54,7 @@ public function run(): void
5354
]);
5455
}
5556
}catch (\Exception $e) {
56-
echo "Error: " . $e->getMessage() . "\n";
57-
echo $e->getTraceAsString();
57+
Log::debug($e);
5858
}
5959
}
6060
}

tests/TestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Http\Middleware\SecurityHeaders;
66
use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
77
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
8+
use Log;
89
use RuntimeException;
910
use Tests\Support\AssertsAgainstSlackNotifications;
1011
use Tests\Support\AssertHasActionLogs;
@@ -52,7 +53,7 @@ protected function setUp(): void
5253
\DB::statement("SET time_zone = '+00:00'");
5354

5455
} catch (\Throwable $e) {
55-
56+
Log::debug($e);
5657
}
5758
}
5859

0 commit comments

Comments
 (0)