houseabsolute / Log-Dispatch

Dispatches messages to one or more outputs
https://metacpan.org/release/Log-Dispatch/
Other
12 stars 29 forks source link

Potentially allowing for log_and_die to be used in a terse fashion #62

Open ghost opened 4 years ago

ghost commented 4 years ago

Greetings. Would either of the following API adjustments be considered as acceptable? Firstly, for log_and_die and log_and_croak to allow for the level parameter to be optional, defaulting to "error". Secondly, for the same methods - or perhaps new ones - to accept a single parameter containing the message.

$log->log_and_die(level => 'error', message => 'Something happened');
$log->log_and_die(message => 'Something happened');
$log->log_and_die('Something happened');
$log->die('Something happened'); # ... perhaps?