51 ourLogFile =
new ofstream (fileName.Str ());
63 ourLogFile =
new ofstream (fileName.Str ());
118 return sizeof (RunLog) +
119 curLine.MemoryConsumedEstimated () +
120 fileName.MemoryConsumedEstimated () +
121 lastLine.MemoryConsumedEstimated () +
122 sizeof (*ourLogFile);
129 fileName
= _fileName;
131 ofstream* newLogFile =
new ofstream (fileName.Str ());
133 logFile = newLogFile;
138 ourLogFile = newLogFile;
145 fileName
= _fileName;
147 ofstream* newLogFile =
new ofstream (fileName.Str (), ios::app);
149 logFile = newLogFile;
154 ourLogFile = newLogFile;
161 msgQueue = _msgQueue;
200 void RunLog::GetLoggingLevel ()
214 loggingLevel = _loggingLevel;
232 void RunLog::DisplayTimeStamp ()
240 if (curLevel > loggingLevel)
245 (*logFile) << procId <<
" - " ;
255 if ((curLevel > loggingLevel) || (str == NULL))
269 if (strcmp (str,
"\n") == 0)
273 KKStrPtr msgStr =
new KKStr (curLine.Len () + 10);
274 *msgStr << procId <<
" - " << osGetLocalDateTime ().Time () <<
"->" << curLine;
275 msgQueue->AddMsg (msgStr);
381 # ifdef USE_SECURE_FUNCS
382 sprintf_s (buff,
sizeof (buff),
"%f", right);
384 sprintf (buff,
"%f", right);
431 VectorKKStr::const_iterator idx;
432 for (idx = right.begin (); idx != right.end (); ++idx)
433 (*
this) << *idx << endl;
442 if (curLevel <= loggingLevel)
446 Append (o.str ().c_str ());
462 logFile->write (s.Str (), s.Len ());
487 (*logFile) << s << endl;
__int16 kkint16
16 bit signed integer.
KKStr(kkint32 size)
Creates a KKStr object that pre-allocates space for 'size' characters.
void AppendInt32(kkint32 i)
void DetachFile()
Closes out current log file and starts writing to stdout aka 'cout'.
KKStr StrFormatInt64(kkint64 val, const char *mask)
RunLog(const char *_fileName)
Creates instance with a log messages written to file 'fileName'.
KKB::DateTime osGetLocalDateTime()
Returned the current local date and time.
void AddMsg(const KKStr &msg)
RunLog(std::ostream &errorLogStream)
Creates instance where logging messages are written to file stream specified by 'errorLogStream'.
unsigned __int16 kkuint16
16 bit unsigned integer.
KKStr & operator=(const char *src)
unsigned __int32 kkuint32
RunLog & Level(kkint32 _level)
KKStr & operator=(KKStr &&src)
void WriteLine(const KKStr &s)
Writes a line of text to log file; does not check logging level; and does not write any preview text ...
RunLog(const KKStr &_fileName)
Creates instance with a log messages written to file 'fileName'.
void AppendUInt32(kkuint32 i)
RunLog()
Creates an instance were logging will go to the console.
kkint32 MemoryConsumedEstimated() const
void AttachMsgQueue(MsgQueuePtr _msgQueue)
All activity that is written to the log file will be added as messages to '_msgQueue'.
RunLog(std::ostream *logStream)
Creates instance where logging messages are written to file stream pointed to by 'logStream'.
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
unsigned __int64 kkuint64
KKStr StrFormatInt(kkint32 val, const char *mask)
void AttachFileAppend(const KKStr &_fileName)
Call this method to start appending logging messages to a different file.
std::ostream &__cdecl operator<<(std::ostream &os, const KKStr &str)
const char * Str() const
Returns a pointer to a ascii string.
void SetLoggingLevel(kkint32 _loggingLevel)
void AttachFile(const KKStr &_fileName)
Call this method to start logging messages to a different file.
KKStr & operator=(const KKStr &src)
Used for logging messages.
void AttachFile(std::ostream &_logFile)
Call this method to start logging messages to a specific file stream.
void Append(const char *str)
Appends string to log; generally used by other Log methods but can be called by public.
void WriteLine(const char *s)
Writes a line of text to log file; does not check logging level; and does not write any preview text ...
Maintains one instance of a GoalKeeper object that can be used anywhere in the application.
const TimeType & Time() const
RunLog(MsgQueuePtr _msgQueue)