-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Wanted to get your thoughts on making BuffLog more flexible and make it "safer" to use.
There was an incident that happen when I've integrated BuffLog with the analyze workers
How it works now is that we call Monolog directly but if the 2nd param type isn't correct, it will throw an exception and crash the script.
I've also noticed some challenges when replacing all the var_dump in the analyze code base by trying to guess what type are the variables.
Here my question/suggestion:
I like the flexibility of a var_dump($param)
because we can use it without worrying much about about what $param
is. I also believe it's used because it will never crash the code.
- What do you think on allowing any type of arguments: array, int, float, string for the 2nd argument? It seems like in the PHP world it's called a "mixed" type if we can't predict the type of a parameter.
- Also we can check if the 1st parameter is a string and not throw any exception if not.
So we would have prototype that looks lilke that:
BuffLog::notice(string , mixed);
BuffLog::debug(string , mixed);
...
// instead of
BuffLog::notice(string , array);
BuffLog::debug(string , array);
Thoughts? :)
Metadata
Metadata
Assignees
Labels
No labels