Skip to content

Commit

Permalink
Main: Log - use put_time for timestamp formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 1, 2024
1 parent 7ed8058 commit 6b8123a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions OgreMain/src/OgreLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,9 @@ namespace Ogre
{
if (mTimeStamp)
{
struct tm *pTime;
time_t ctTime; time(&ctTime);
pTime = localtime( &ctTime );
mLog << std::setw(2) << std::setfill('0') << pTime->tm_hour
<< ":" << std::setw(2) << std::setfill('0') << pTime->tm_min
<< ":" << std::setw(2) << std::setfill('0') << pTime->tm_sec
<< ": ";
auto t = std::time(nullptr);
auto pTime = std::localtime(&t);
mLog << std::put_time(pTime, "%T: ");
}
mLog << message << std::endl;

Expand Down

0 comments on commit 6b8123a

Please sign in to comment.