[SOLVED OGRE 1.9] Log Manager

Problems building or running the engine, queries about how to use features etc.
Post Reply
malium
Halfling
Posts: 43
Joined: Mon Aug 25, 2014 4:01 pm
Location: Spain

[SOLVED OGRE 1.9] Log Manager

Post by malium »

Hi guys, I'm trying to create the log file, but when I use a name generated by timedate, it simply doesn't show up, here's the code:

Code: Select all

m_logmgr = new Ogre::LogManager();
time_t rawtime;
struct tm * timeinfo;
char buffer[80];

time(&rawtime);
timeinfo = localtime(&rawtime);

strftime(buffer, 80, "%d-%m-%Y %I:%M:%S", timeinfo);
Ogre::String str(buffer); str = str + ".log";
const Ogre::String strs = str;
m_Log = m_logMgr->createLog(strs, true, true, false);
m_Log->setDebugOutputEnable(true);
but if I do this, work:

Code: Select all

m_logMgr = new Ogre::LogManager();

m_Log = m_logMgr->createLog("Log.log", true, true, false);
m_Log->setDebugOutputEnable(true);
Last edited by malium on Fri Apr 24, 2015 9:26 am, edited 1 time in total.
NotCamelCase
Greenskin
Posts: 140
Joined: Sun Feb 03, 2013 6:32 pm
x 8

Re: [OGRE 1.9] Log Manager

Post by NotCamelCase »

It may be a formatting issue, did you check your timeinfo output? Is the string format matching it?
Check out my projects: https://github.com/NotCamelCase
malium
Halfling
Posts: 43
Joined: Mon Aug 25, 2014 4:01 pm
Location: Spain

Re: [OGRE 1.9] Log Manager

Post by malium »

I logged strs and str, both give me the same:

Code: Select all

23-04-2015 12:40:57.log
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: [OGRE 1.9] Log Manager

Post by al2950 »

malium wrote:I logged strs and str, both give me the same:

Code: Select all

23-04-2015 12:40:57.log
Well, at least in windows, ':' is an invalid file name character.
malium
Halfling
Posts: 43
Joined: Mon Aug 25, 2014 4:01 pm
Location: Spain

Re: [OGRE 1.9] Log Manager

Post by malium »

Is that, true?? OMG I must look like a noob :lol: Sorry for asking this stupid things and thank you!
Post Reply