Comments (2)
For deleting items from lists, I always count down from the last element to zero so the index is always valid. Saves you the boolean for the repeat termination.
Like (untested from the top of my head) this:
for i := FLoggerThread.Appenders.Count -1 downto 0 do
if Self.FLoggerThread.FAppendersDecorators[i].FLogAppender = aAppender then
begin
Self.FLoggerThread.FAppendersDecorators.Delete(i);
break;
end;
from loggerpro.
@luebbe Edit: I get it! Your version of the loop allways evaluates the Count property so in case of delete the decrease of count prevent the index to go out of range.
It's true that you can break the loop after the delete but I think for
is intended to loop trought the entire range. repeat until
on the other hand can stop at some point. This is my personal opinion!
from loggerpro.
Related Issues (20)
- Feature Request for low level Windows Event logger HOT 4
- File.Appender error? HOT 3
- Adding Date to fileappender filename HOT 2
- Feature request: conditional compilation for depencencies HOT 1
- AddAppender raises AccessViolation and duplicates appenders HOT 2
- FileAppender write in the wrong position. HOT 5
- Only one backup file ever used HOT 2
- Application Freeze on freelibrary with dll using LoggerPro HOT 1
- Feature Request for detail level HOT 1
- Enabling appenders feature request HOT 4
- Hi Microsoft AppCenter Support HOT 2
- Question: PID and log rotation? HOT 3
- A small XE4 compilation issue and a fix HOT 1
- why not fatal error level log? HOT 4
- Changes introduced in change request #103 produce an exception HOT 1
- Authentication on TElasticSearchAppender HOT 1
- Exception on Syslog Appender when message/payload is too big HOT 3
- [feature request] EMail Appender: Collective E-Mail HOT 1
- Please add the possibility to log to a TStringList.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loggerpro.