You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
I think having two events (before and after) for writeLog() would be beneficial for many projects.
E.g. I'm currently stuck trying to add a globally consistent "default" context to log messages so that I and other devs won't have differences while logging information because some other devs write the contextual information like the class to the log message.
Having an event prior of a message being logged would enable everyone to add a default context kinda like this:
// Just an example for visualization purposespublicfunction__invoke(Logger$logger)
{
$logger->listen(function(MessageTriggered$message) {
$message->context = [
"class" => __CLASS__,
"method" => debug_backtrace()[1]["function"],
"line" => debug_backtrace()[1]["line"],
"values" => $message->context,
];
});
}
Log::debug("Hello world", ["name" => "John"];
which would result in something like this:
localhost.DEBUG: Hello world {"class":"App\Foo\Bar","method":"baz","line":1,"values":{"name":"John"}}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey guys,
I think having two events (before and after) for
writeLog()
would be beneficial for many projects.E.g. I'm currently stuck trying to add a globally consistent "default" context to log messages so that I and other devs won't have differences while logging information because some other devs write the contextual information like the
class
to the log message.Having an event prior of a message being logged would enable everyone to add a default context kinda like this:
which would result in something like this:
The text was updated successfully, but these errors were encountered: