Example #1
0
/**
 * Demonstrate logging a collection.remove().
 *
 * @param \MongoCollection $collection
 *   The demo collection.
 * @param \Psr\Log\LoggerInterface $logger
 *   The logger instance.
 */
function remove_demo(MongoCollection $collection, LoggerInterface $logger)
{
    $logger->debug("Removing documents");
    $logger instanceof TimingLoggerInterface && $logger->startLap();
    $collection->remove();
    $logger->debug('');
}