How to trigger an event when node is saved? I am trying to execute a piece of code when a node is saved. I am using hook_node_update, but it's never triggered when updating a node. Here is my code:

function custom_node_update(Drupal Core Entity EntityInterface $node) {
 // Logs a notice
 \Drupal::logger('custom')-&gt;notice("entity was updated");
}


What is wrong with my code?
The parameter passed to code had syntax error.

The correct code will be

function custom_node_update(Drupal\Core\Entity\EntityInterface $node) {
  // Logs a notice
  \Drupal::logger('custom')-&gt;notice("entity was updated");
}