From: Darksecond <tim...@gm...> - 2007-11-06 19:53:56
|
i vote for a singleton, with functions like 'openLog(string fileName);', 'closeLog()', and 'writeLog(int State);' with state being an enum that provides the importance of the message; for example: enum { INFO, WARNING, ERROR, DEBUG }; and, when the message had the state 'DEBUG' also log it to 'OutputDebugString'. (and to file of course). -Tim On Nov 6, 2007 7:26 PM, Grant McDorman <grm...@gm...> wrote: > I would suggest leaving it as plain text; there isn't much added value to > any other format, especially since the things being logged - particularly > output from xLogMessage - are free format. > > As for design, either a namespace or a singleton (which, for the usage, is > nearly the same), as a C++ iostream. Probably: > namespace Log { > std::ostream getLog(); > std::ostream openLog(); // implied by getLog if not already open > void closeLog(); > }; > or nearly the same thing as a class. > > Also, a distinct debug log would be useful (output via OutputDebugString<http://msdn2.microsoft.com/en-us/library/aa363362.aspx>, > which is discarded if not captured by a debugger or other app, such as > DbgView). For this, I already have a C++ iostream wrapper for it. > > On Nov 6, 2007 10:29 AM, Darksecond <tim...@gm...> wrote: > > > Hey everyone, > > > > i was wondering, how are going to do all the 'random' attachments to the > > new MWSE. > > like logging. do we want it in a class, or a singleton, or something > > else. and how do we want to log, do we want to log in the simple text format > > like we are doing now, or are we going to change to XML (for example)? > > > > -Tim > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Mwse-developers mailing list > > Mws...@li... > > https://lists.sourceforge.net/lists/listinfo/mwse-developers > > > > > > > -- > Grant McDorman > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Mwse-developers mailing list > Mws...@li... > https://lists.sourceforge.net/lists/listinfo/mwse-developers > > |