// // Copyright 2009 Illumina, Inc. // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // // /// \file /// \author Ivan Mikoulitch /// #include #include "SamMD/log.h" clock_t program_start; char time_str_buffer[4096]; ////////////////////////////////////////////////////////////////////// void Log::Initialize() { program_start = clock(); } ////////////////////////////////////////////////////////////////////// void Log::Info(string str) { cout << GetTime() << str << endl; } ////////////////////////////////////////////////////////////////////// void Log::Warning(string str) { cout << GetTime() << "Warning! " << str << endl; } ////////////////////////////////////////////////////////////////////// void Log::Error(string str) { cout << GetTime() << "Error!!! " << str << endl; } ////////////////////////////////////////////////////////////////////// void Log::Exception(string str) { cout << GetTime() << "Exception!!! " << str << endl; } ////////////////////////////////////////////////////////////////////// string Log::GetTime() { double duration = (double)(clock() - program_start) / CLOCKS_PER_SEC; sprintf(time_str_buffer, "%2.0f : ", duration ); return string(time_str_buffer); }