1

Друзья, делаю сервер под Node.js. Подскажите, как лучше всего логировать?
В php логировал так:

    function e($message)
    {
        print(date("H:i:s",(time()+TIME_ZONE)).' '.$message);
    }

    $this->e("The player was disconnect...\n");

1 ответ 1

1

Вот так сделал с миллисекундами...

function e(text)
{
    var date = new Date();
    console.log('['+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()+':'+date.getMilliseconds()+'] '+text);
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.