Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Add timestamps to Command output #2646

Open
jelib3an opened this issue Jun 18, 2021 · 0 comments
Open

Add timestamps to Command output #2646

jelib3an opened this issue Jun 18, 2021 · 0 comments

Comments

@jelib3an
Copy link

Similar to laravel/framework#37591

I've been adding this trait to my commands so all outputs have timestamps on them. I find it helpful in logs or for debugging long running scripts.

trait TimestamppedOutputTrait
{
    public function line($string, $style = null, $verbosity = null)
    {
        $string = now()->format("[Y-m-d H:i:s] ").$string;
        return parent::line($string, $style, $verbosity);
    }
}

Curious, would others find this useful if it were added to laravel/framework or laravel/laravel?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant