Click here to Skip to main content
15,889,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Logging in VC++ Pin
Moak10-Aug-10 4:28
Moak10-Aug-10 4:28 
GeneralRe: Logging in VC++ Pin
dilara semerci10-Aug-10 20:09
dilara semerci10-Aug-10 20:09 
GeneralRe: Logging in VC++ Pin
CPallini10-Aug-10 20:59
mveCPallini10-Aug-10 20:59 
QuestionRe: Logging in VC++ Pin
dilara semerci10-Aug-10 21:02
dilara semerci10-Aug-10 21:02 
AnswerRe: Logging in VC++ Pin
CPallini10-Aug-10 21:11
mveCPallini10-Aug-10 21:11 
AnswerRe: Logging in VC++ Pin
Moak10-Aug-10 23:20
Moak10-Aug-10 23:20 
GeneralRe: Logging in VC++ Pin
PJ Arends10-Aug-10 22:40
professionalPJ Arends10-Aug-10 22:40 
GeneralRe: Logging in VC++ Pin
Moak10-Aug-10 23:01
Moak10-Aug-10 23:01 
dilara semerci wrote:
have a size limit-say 50mb- and keep the newest data but erase the oldest not to exceed this size limit


Sure this is possible. If you want to keep log files under a certain size limit, the algorithm would be similar:

Write to end of log file. If it is over size X (e.g. 50MB), open a new file, seek log file 10% forward, copy the remaining log file, swap files (remove, rename), reopen new file. The reason why I suggested to skip 10% forward, is so that you don't have to to this operation every time. The application can fill the log file, it will be decreased in size from time to time, then it can fill it up again.

As an alternative to a single log file, use multiple files: Check if writing to end of log file will be over size X, if not write to end of file and if yes open a new file under a new name (overwrite if it exists) and continue logging there. The idea is to have multiple files to write to, e.g. logfile1.txt logfile2.txt logfile3.txt ... if you filled logfile3.txt you can start over with logfile1.txt again. Size of individual log file = total logging size X / number of files. Not very common, but possible.

Does this help? Smile | :)
/M

QuestionCRichEditCtrrl and EN_REQUESTRESIZE [modified] Pin
Leif Goodwin10-Aug-10 1:50
Leif Goodwin10-Aug-10 1:50 
QuestionCRectTracker on CScrollView Pin
mesajflaviu10-Aug-10 1:39
mesajflaviu10-Aug-10 1:39 
AnswerRe: CRectTracker on CScrollView [Repost] Pin
Richard MacCutchan10-Aug-10 1:42
mveRichard MacCutchan10-Aug-10 1:42 
AnswerRe: CRectTracker on CScrollView Pin
Niklas L10-Aug-10 1:44
Niklas L10-Aug-10 1:44 
GeneralRe: CRectTracker on CScrollView Pin
mesajflaviu10-Aug-10 10:19
mesajflaviu10-Aug-10 10:19 
QuestionBoost Library Pin
002comp10-Aug-10 0:40
002comp10-Aug-10 0:40 
AnswerRe: Boost Library Pin
Niklas L10-Aug-10 1:01
Niklas L10-Aug-10 1:01 
GeneralRe: Boost Library Pin
002comp10-Aug-10 2:48
002comp10-Aug-10 2:48 
GeneralRe: Boost Library Pin
Niklas L10-Aug-10 2:58
Niklas L10-Aug-10 2:58 
GeneralRe: Boost Library Pin
002comp10-Aug-10 18:02
002comp10-Aug-10 18:02 
GeneralRe: Boost Library Pin
Niklas L10-Aug-10 22:13
Niklas L10-Aug-10 22:13 
Questionany idea for "auto-cast"ing? Pin
includeh1010-Aug-10 0:24
includeh1010-Aug-10 0:24 
AnswerRe: any idea for "auto-cast"ing? Pin
Sauro Viti10-Aug-10 0:44
professionalSauro Viti10-Aug-10 0:44 
AnswerRe: any idea for "auto-cast"ing? Pin
CPallini10-Aug-10 0:45
mveCPallini10-Aug-10 0:45 
AnswerRe: any idea for "auto-cast"ing? PinPopular
Aescleal10-Aug-10 1:29
Aescleal10-Aug-10 1:29 
GeneralRe: any idea for "auto-cast"ing? Pin
Chris Losinger10-Aug-10 5:29
professionalChris Losinger10-Aug-10 5:29 
GeneralRe: any idea for "auto-cast"ing? Pin
Aescleal10-Aug-10 5:59
Aescleal10-Aug-10 5:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.