dev: loggy

This commit is contained in:
Andras Bacsai
2024-10-17 10:04:49 +02:00
parent f600c1b37d
commit 55cae39e55
4 changed files with 96 additions and 1 deletions

View File

@@ -4010,3 +4010,18 @@ function loadConfigFromGit(string $repository, string $branch, string $base_dire
// continue
}
}
function loggy($message = null, array $context = [])
{
if (!isDev()) {
return;
}
if (function_exists('ray') && config('app.debug')) {
ray($message, $context);
}
if (is_null($message)) {
return app('log');
}
return app('log')->debug($message, $context);
}

View File

@@ -15,6 +15,7 @@
"laravel/fortify": "^v1.16.0",
"laravel/framework": "^v11",
"laravel/horizon": "^5.29.1",
"laravel/pail": "^1.1",
"laravel/prompts": "^0.1.6",
"laravel/sanctum": "^v4.0",
"laravel/socialite": "^v5.14.0",

79
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c47adf3684eb727e22503937435c0914",
"content-hash": "943975ec232403b96a40d215253492d8",
"packages": [
{
"name": "amphp/amp",
@@ -3144,6 +3144,83 @@
},
"time": "2024-10-08T18:23:02+00:00"
},
{
"name": "laravel/pail",
"version": "v1.1.5",
"source": {
"type": "git",
"url": "https://github.com/laravel/pail.git",
"reference": "b33ad8321416fe86efed7bf398f3306c47b4871b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pail/zipball/b33ad8321416fe86efed7bf398f3306c47b4871b",
"reference": "b33ad8321416fe86efed7bf398f3306c47b4871b",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"illuminate/console": "^10.24|^11.0",
"illuminate/contracts": "^10.24|^11.0",
"illuminate/log": "^10.24|^11.0",
"illuminate/process": "^10.24|^11.0",
"illuminate/support": "^10.24|^11.0",
"nunomaduro/termwind": "^1.15|^2.0",
"php": "^8.2",
"symfony/console": "^6.0|^7.0"
},
"require-dev": {
"laravel/pint": "^1.13",
"orchestra/testbench": "^8.12|^9.0",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-type-coverage": "^2.3",
"phpstan/phpstan": "^1.10",
"symfony/var-dumper": "^6.3|^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
},
"laravel": {
"providers": [
"Laravel\\Pail\\PailServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Pail\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
},
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"description": "Easily delve into your Laravel application's log files directly from the command line.",
"homepage": "https://github.com/laravel/pail",
"keywords": [
"laravel",
"logs",
"php",
"tail"
],
"support": {
"issues": "https://github.com/laravel/pail/issues",
"source": "https://github.com/laravel/pail"
},
"time": "2024-10-15T20:06:24+00:00"
},
{
"name": "laravel/prompts",
"version": "v0.1.25",

2
storage/pail/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore