Longman\TelegramBot\TelegramLog::debug PHP Method

debug() public static method

Report debug log
public static debug ( string $text )
$text string
    public static function debug($text)
    {
        if (self::isDebugLogActive()) {
            self::$monolog->debug($text);
        }
    }

Usage Example

 public function testExternalStream()
 {
     $file = $this->logfiles['external'];
     $this->assertFileNotExists($file);
     $external_monolog = new Logger('bot_update_log');
     $external_monolog->pushHandler(new StreamHandler($file, Logger::ERROR));
     $external_monolog->pushHandler(new StreamHandler($file, Logger::DEBUG));
     TelegramLog::initialize($external_monolog);
     TelegramLog::error('my error');
     TelegramLog::debug('my debug');
     $this->assertFileExists($file);
     $file_contents = file_get_contents($file);
     $this->assertContains('bot_update_log.ERROR: my error', $file_contents);
     $this->assertContains('bot_update_log.DEBUG: my debug', $file_contents);
 }
All Usage Examples Of Longman\TelegramBot\TelegramLog::debug