Is there a specific set of values that can go in $type or is it free text?
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | watchdog-D6.patch | 1.08 KB | rdrh555 |
| #8 | 782442-smallfix.patch | 1.16 KB | jhodgdon |
| #7 | 782442-retry.patch | 1.16 KB | Anonymous (not verified) |
| #5 | 782442.patch | 1.16 KB | Anonymous (not verified) |
Comments
Comment #1
jhodgdonFixing title. Obviously if this user had this question, it isn't documented well enough that $type has to choose from the constants like WATCHDOG_ERROR that are at the top of includes/bootstrap.inc.
We should fix this in Drupal 7, and then back port to Drupal 6.
Comment #2
jhodgdonThis would not be a bad project for a novice API doc contributor. My suggestion would be to put something like "a constant such as WATCHDOG_ERROR, WATCHDOG_WARNING, etc." in the $type param section. Those will turn into links.
Comment #3
xenophyle commentedI noticed there are two parameters that should be documented more completely: $type and $severity. Based on some user comments for the watchdog doc page, $severity is the one that needs to be chosen from WATCHDOG_ERROR, WATCHDOG_WARNING, etc. I found that $type can be anything you want, but it seems to be common practice to use the name of the module that is calling watchdog. Thanks for your quick response!
Comment #4
jhodgdonYou are correct - my mistake - $severity is the one that uses the constants, and $type is conventionally set to the module that is generating the error (but can be set to any string).
Anyway, still needs doc. :)
Comment #5
Anonymous (not verified) commentedPut something together from your suggestions. Take a peak!
Comment #6
jhodgdonThis is close... A few wording/grammar/punctuation suggestions:
Punctuation:
... belongs. Can be any string, but...
Also, watchdog -> watchdog() [always put () after function names in docblocks]
contents -> values
Comment #7
Anonymous (not verified) commentedThanks for the input! Here it is again. :)
Comment #8
jhodgdonHow about this?
Comment #9
dries commentedCommitted to CVS HEAD. Thanks.
Comment #10
jhodgdonThis should probably be ported to 6.x.
Comment #11
rdrh555 commentedComment #12
jhodgdonPatch applies cleanly and looks fine to me. Thanks!
Comment #13
gábor hojtsyThanks, committed. BTW the patch had dashes in place of underscores in WATCHDOG_* constant names, fixed that before committing.