As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I was wondering; which logging libraries for Delphi do you prefer?
CodeSite
SmartInspect
Log4Delphi
TraceFormat
Please try to add a reasoning why you prefer one over the other if you've used more than one.
I'll add suggestions to this question to keep things readable.
I've used Codesite and it has been fantastic. On one project, a word-processor, I could easily output a million debug lines, all structured, and Codesite helped greatly with its auto-collapsing indented output. For any task where you have to know what really is happening "underneath" a process that can't be interrupted by user interaction, Codesite is really good. I recommend it heartily.
SmartInspect is really useful. It is the only one I have used. The logging library is good, but the console and the remote TCP/IP logging takes it over the top. I think CodeSite has some similar features.
Take a look at the features of this Open Source unit:
http://blog.synopse.info/post/2011/04/14/Enhanced-logging-in-SynCommons
logging with a set of levels (not only a hierarchy of levels);
fast, low execution overhead;
can load .map file symbols to be used in logging;
compression of .map into binary .mab (900 KB -> 70 KB);
optional inclusion of the .map/.mab into the .exe;
handle libraries (.ocx/.dll);
exception logging (Delphi or low-level exceptions) with unit names and line numbers;
optional stack trace with units and line numbers;
methods or procedure recursive tracing, with Enter and auto-Leave;
high resolution time stamps, for customer-side profiling of the application execution;
set / enumerates / TList / TPersistent / TObjectList / dynamic array JSON serialization;
per-thread, rotating or global logging;
multiple log files on the same process;
optional colored console display;
optional redirected logging (e.g. to third party library, or to a remote server);
log viewer GUI application, with per event or per thread filters, and method execution profiler;
Open Source, works from Delphi 5 up to XE6 (Win32 and Win64).
Your feedback is welcome!
And don't forget the free open source TraceTool
I have just updated Log4Delphi 0.8 on the Sourceforge page and it rolls up patches and bug fixes from the last 4 years.
Sourceforge Log4Delphi Downloads
Log4net/ports of Log4xxx to other languages. It's open-source, pretty wide-spread, popular, has a good community behind, and isused widel (for example, in Hibernate/nHibernate).
An important value behind CodeSite is Ray Kanopka's support. He personally answers emails and newsgroup posts, and has done so for many years. His answers often contain code that illustrates excellent coding habits.
I didn't use CodeSite probably because I'm completely happy with SmartInspect. Highly recommended.
I am looking into Codesite as well. I built my own in the past but I really like the featrues in Codesite. The Raize componenets are very well written and always quality stuff.
Log4D is another implementation which is based on Log4J and easy to extend and configure.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Delphi developers has several tools (several alternatives to ASP.NET) for building web applications.
While No.1 framework is Intraweb, there is a lot of interest around ExtJS, that has 2 incarnations:
1) the opensource ExtPascal
2) the closedsource Raudus
Now the products are different, Raudus never supports the latest ExtJS version (while ExtPascal does because as far as I read it "almost automatically updates itself to the latest ExJS version"), Raudus "seems" much RAD (much similar to Intraweb from the RAD point of view).
Anyway why chose one or the other?
Why Raudus (since it is free) cannot become Open Source? Or does Raudus use ExtPascal behind the scenes?
Comment: uniGUI seems at first sight to combine the good part of Raudus (the RAD part) and ExtPascal (being based on extPascal).
Talking about Raudus, I'd be careful! You can download it for free, indeed. I was about to start using it when I realized there's no single word on its usage license. There's no license in fact, or I was unable to find it under "standard" locations (website? no. installer? no. README / LICENSE file? no.)
Thus I'd be careful with using library which doesn't specify it's license. Especially if you're about to start some project which will use it intensely - just imagine what happens when it comes out that you need to pay big amount of money for using it ...
Why use any of them? RAD in the form of Intraweb and tools like it, is not appropriate for web programing. It doens't separate the GUI from bussines logic well. In other words there is no true MVC approach there. Maybe ExtPascal is different here, but the point is elsewhere.
ExtJS is a very well written RAI JS library. It feels almost like putting blocks of code together in a very object oriented way. You can easily build whole GUI with ExtJS without any backend support. This way your whole GUI is in javascript files and no backend is needed. Backend only processes the ajax call and provides data / processes data. This way you have a clear separation of concerns.
This can be easily done without any frameworks. Yes framework would come in handy but it would have to be done in a ASP.NET MVC or Ruby on Rails way. No RAD and no visual designers. New web developers often make those mistakes. But if you program for the web long enough you come to appreciate the separation of GUI and logic and the simplicity of HTML. Web programming is different from desktop programming at least to a degree.
To answer your question. From what I have seen, I like ExtPascal better. It seems a purer web development tool than Raudus. But I admit I have only seen both from the surface and from demo videos, so I cannot judge, only speculate :)
The Raudus developer put up a new blog post in late October and claims, well I'll let you read the snippet for yourself:
"Raudus license is freeware as written in license.txt. You CAN use Raudus in commercial projects. Raudus sources are not available yet."
Edit: There is a license statement at the bottom of the http://www.raudus.com/ page.
"License
Raudus is freeware. You can freely use Raudus for commercial purposes."
As to contacting the author, try this from the same page: E-mail: igor#klopov.com
After using Raudus for a few months I decided to post my own answer.
The framework is improving, Sencha touch support now it is not complete but sufficient to create usable web applications optimized for mobile devices.
RFE, a new front end, not based on Sencha Touch is under developement and in next Raudus release (that should be out soon) there will be a usable preview of the new controls set.
So while ExtPascal seems frozen, Raudus is in progress and promising.
Update: I stopped using Raudus, it dropped ExtJs support and now it ships with own controls, that will never match the beauty and richness of extjs components. I am now going for IW + cgdevtools components that are Jquery UI for IW.
user193655 --> Depending on what you do be carefull with both approaches. I am really a big fan on Delphi or Freepascal/Lazarus - I am not very certain if the approach of bringing 3GL bindings to the Javascript stuff is wise.
MVC - depending on what you do - in PHP you have the Yii Framwork or Prado. Maybe the second has some ideas from .net built in which are very easy to understand by Delphi developers. PRADO is an event driven approach while YII Framework is absolutely cool and unix like.
After using Raudus it seems that it is not practical for large scale of applications.
According to their documentation and I have also sampled, it serializes all client request into single main thread. However it process client request and response generation part in multi-threaded enviornment.
But main thread issue is quite important as it directly impact the response time if one action is taking more time in the main thread, others will keep waiting.
Any suggestions to resolve this issue?
Raudus:
Relies upon Delphi, in which:
Is verbose;
Relies upon Microsoft Windows;
High-cost to adapt to or to maintain;
Quote from raudus.com: "Raudus is freeware. You can freely use Raudus for commercial purposes. Raudus sources are not available yet." — This, to me, will be never a license. On the homepage, simply there is no documentation about Terms of Service or something like that. Hence I won't deal with their services.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there any way to disassemble my .dll file again into machine code?
What applications do I need for this and how much could be recovered?
Check PE File Explorer, this tool is amazing, is built with Delphi, and has special support for Delphi applications.
You can analyze, disassemble, edit the resources
PE Explorer is the most feature-packed
program for inspecting the inner
workings of your own software, and
more importantly, third party Windows
applications and libraries for which
you do not have source code. Once you
have selected the file you wish to
examine, PE Explorer will analyze the
file and display a summary of the PE
header information, and all of the
resources contained in the PE file.
From here, the tool allows you to
explore the specific elements within
an executable file.
(source: pe-explorer.com)
You need a disassembler, like IDA Pro. They have a free edition too. You'll get back machine code (assembly), and you should be able to pick out the function calls made to the Windows API.
If you lost the source file and you really only need to "get your work back", then you might as well start re-coding it because you're not going to get anything useful out of decompiler. I haven't been able to get anything re-compilable out of a decompiler since the days of Ms-DOS COM files (not to be confused with Windows COM!).
A modern file, written in an high level language, ran throw an optimizing compiler simply doesn't include everything that's needed to reconstruct the source code.
Examples, and it's just the top of the iceberg:
Delphi's optimizing linker will SKIP code that's not used. Ever noticed when you want to place an brakepoint on a line of code and when the program starts the brakepoint is ignored because the code has been optimized-out?
Delphi's optimizing compiler has the option of doing all sorts of things with your code:
It can inline procedures (so they're no longer where you wrote them, they're where the call is made).
It can unwind "for" loops (so where you had an "for i:=1 to 10 do something" you now have "something; something; something;...".
Local variables get optimized, addresses get reused.
Data structures are aligned to whatever the rule of the day is. So your one word + 1 byte structures might have 4 or 8 bytes in memory, not 3 as you might expect.
Code gets imported from other libraries. An DLL is not an DCU. A 3 lines DLL might actually import thousands of lines of code from those "uses" clauses.
You won't be able to get more than assembly code, because Delphi is native unlike Java or .Net Languages, where you can get a whole bunch more of information.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What is the best GRID and TREE control for DELPHI win32. It should also be DB-Aware.
I have use the DBGrid but it is very limited and lakes a lot of new features
DevExpress as an impressive collection of tools and features, but a very high price.
What is your GRID/TREE of choice its pros and cons, and of course its price tag.
Your are asking for the best and rulling out the #1 ;).
For the tree the "best" is http://www.soft-gems.net/index.php?option=com_content&task=view&id=12&Itemid=33, because is virtual, is very flexible and very fast. But is harder to use (ie. in comparation with a regular tree control).
With that is possible emulate a grid. Also is free & have source. As far I know, is the best tree control across any language & plataform in this universe.
Well, I have the DevExpress VCL subscription, and although the initial price seems high it is good value and the renewal is sensible. The grid will do all you ever want (and more) though you do have to spend some time learning it so you can understand where the features are controlled. The advantage of the subscription is that you get pre-release betas, and you get everything which means that I've been able to use controls I'd never justify individually but they are in my toolkit so I can use them.
TMS Component Pack have a good Grid Components and a lot of other, it's the main competitor to DevExpress components
also if you want a nice,light and fast grid have a look at NextGrid
VirtualTreeView has been mentioned here already. While it is quite flexible and I am currently using it, there are a few things I don't like about it:
It is no longer actively maintained by its original author Mike Lischke and it is not clear whether there is somebody else in charge now.
It has quite a steep learning curve. Be prepared to study the provided example applications closely, otherwise you will not be able to use it.
It comes with online help but that help is even worse than that of Delphi 2005. Yes, it does cover most of the properties, methods and classes, but mostly the help is not very "helpful". (I am aware that I have no right to demand good online help for a free tool, but it is a factor nonetheless.)
I don't like the way the virtualization is actually done. I would have done it differently. (I don't know whether my way would have been better, though. Your mileage may vary.)
It feels stuffed with too many features. I would have liked something more lightweight.
I have used in my application ElTree by LMD Innovative for almost 10 years. It is part of their excellent ElPack suite of tools. They recently included a version called ElXTree which has some extras. They are both DB-aware.
I was considering switching to Virtual Treeview a while back. I compared the two, and could not find anything I needed that Virtual Treeview did that ElTree didn't. ElTree has a Virtual mode as well if you want it.
ElTree does things a bit differently and than Virtual Treeview. Compare the two before you decide, or even try them both first. You may find you like the way one works better than the other.
Advantages of ElTree over Virtual Treeview:
It is still being actively maintained and they have good support on their Newsgroups. Whereas Virtual Treeview is now Open Source and the original author Mike Lischke is no longer actively working on it.
ElPack already has their Delphi 2009 compatible version out. In fact, they've had it out for several months already. Virtual Treeview does not have a version out for Delphi 2009 yet.
Disadvantage of ElTree:
It is not free, but it is less expensive than DBGrid. And you may find the other ElPack VCL Components (all Unicode enabled) to be useful for your product as well.
Version 7.0 (for Delphi 2009) of LMD ElPack is 159 Euros. If you decide to buy it, pay in Euros because ShareIt charges exorbitant exchange rates.
Also see my answer to: Delphi Active Commercial Components.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I recently upgraded from Delphi 4 to Delphi 2009. With Delphi 4 I had been using GpProfile by Primoz Gabrijelcic as a profiler and Memory Sleuth by Turbo Power for memory analysis and leak debugging. Both worked well for me. But I now need new tools that will work with Delphi 2009.
The leader in Profiling/Analysis tools for Delphi by a wide margin is obviously AQTime by AutomatedQA. They recently even gobbled up Memproof by Atanas Soyanov, which I understood was an excellent and free memory analysis tool, and incorporated its functionality into AQTime. But AQTime is very expensive for an individual programmer. It actually costs more than the upgrade to Delphi 2009 cost!
So my question is: Are there other less expensive options to do profiling and memory analysis in current versions of Delphi that you are happy with and recommend, or should I bite the bullet and pay the big bucks for AQTime?
Addenum: It seems the early answerers are indicating that the FastMM manager already included in Delphi is very good for finding memory leaks.
So then, are there any good alternatives for source code profiling?
One I'm curious about is ProDelphi by Michael Adolph which is less than one sixth the cost of AQTime. Do you use it? Is AQTime worth paying six times as much?
Addenum 2: I downloaded trial versions of both AQTime and ProDelphi.
AQTime was a bit overwhelming and a little confusing at first. It took a few hours to find some of the tricks needed to hook it up.
ProDelphi was very much like the GpProfile that I was used to. But its windows are cluttered and confusing and it's not quite as nice as GpProfile.
To me the big differences seem to be:
ProDelphi changes your code. AQTime does not. Changing code may corrupt your data if something goes wrong, but my experience with GpProfile was that it never happened to me. Plus one for AQTime.
ProDelphi requires you turn optimization off. But what you want to profile is your program with optimization on, the way it will be run. Plus one for AQTime.
ProDelphi only can profile down to the function or procedure. AQTime can go down to individual lines. Plus 2 for AQTime.
ProDelphi has a free version that will profile 20 routines, and its pro version costs less than $100 USD. AQTime is $600 USD. Plus 4 for ProDelphi.
The score is now 4-4. What do you think?
Addenum 3: Primoz Gabrijelcic is planning to get GpProfile working again. See his comments on some of the responses below. He on StackOverflow as Gabr.
Addenum 4: It seems like there may be a profiler solution after all. See Andre's open source asmprofiler, described below.
For the price, you cannot beat FastMM4 as a memory tracker. It's simple to use yet powerful and well integrated with Delphi.
I guess that you know that, without downloading, installing or changing anything else, just putting this line
ReportMemoryLeaksOnShutDown := True;
anywhere in your code, will enable basic reporting of memory leaks.
If you need more like crash information, EurekaLog is a very good product that we use. MadExcept also has a good reputation...
For profiling specifically, we have AQTime.
As for gpProfile, you can try and bug gabr on SO for an update... or go and update gpProfile yourself as it is open source. ;-)
I've made an open source profiler for Delphi:
http://code.google.com/p/asmprofiler/
It's not perfect, but it's free and open source :-).
The main reason I made it was because I missed an exact call tree.
For example, ProDelphi only stores a summary and total counts of all calls,
you cannot see what calls a specific procedure at a specific time did (or time
duration).
And it has a time chart, so you can see how the call duration changed over time.
Also take a Look at Eric Grange's Sampling Profiler
I've been very happy with AQtime for profiling.
Having used both GpProfile and AQTime I have found both to be effective at finding what method call is causing a bottle neck.
However AQTime can also tell me what line of code is causing this, without making any changes to my source code (although it works best with TD32 debugging and debug dcus).
I recently used it to speed up a routine by about 30x (due to bad use of a internal library function)
However I didn't have to pay for it myself!
We use AQTime Pro and are happy with it. Smartbear have recently released a completely free AQTime standard edition. Most of the features are still there but they have of course removed a bit
I agree with you about the interface of ProDelphi, but it does a good enough job that we're happy to stay with it. We only need to profile very occasionally when we have a significant performance issue, and it's always helped us find the problem pretty quickly. Very good value for money, and Michael seems pretty good about keeping it updated for new versions.
One thing I would suggest is that because it does require code to be inserted, having all the relevant code in some kind of VCS is invaluable. When we need to profile, we:
Check all relevant files in
Check them all out
Do the profiling we need, then
Cancel all checkouts, effectively rolling back to where we were.
Has anyone tried the Profiler component at Delphi Area? It is freeware with source and it's writeup says:
If you are looking for an easy and
accurate way to measure execution time
of your code for free, TProfiler is
what you need. TProfiler is a
non-visual and debugging component
that enables you to create named
timers in your code.
Each timer of TProfiler provides the
following information:
The number of times that the timer was
activated (Hit Count) The total
execution time The average execution
time on each hit Execution time on
the first hit Execution time on the
last hit The hit with minimum
execution time The hit with maximum
execution time
It's true, for profiling I miss Primoz' GpProfile, and haven't found a good replacement. I once tried AQTime, but wasn't too happy with it for the price.
For tracking of memory leaks and dodgy memory accesses however I couldn't be happier than I am with FastMM4.
I've been using ProDelphi for a long time & find it meets my needs.
I've been able to achieve stunning results in system performance improvements by using the data it provides.
For small projects the free version is fine.
For larger projects, you'll need the (Paid) pro version.
For a profiler you might try SmartInspect from Gurock Software. I never used GpProfile, but quickly glancing at its feature set reminded me of SmartInspect. Interestingly it doesn't claim to be a profiler, but it seems to be as much of one as GpProfile (unless I am missing something). It supports Delphi 2009 and has a free Trial and is a little cheaper then AQTime.
Note: SmartInspect is a logger rather than a profiler.
The FastMM4 memory manager mentioned in this older answer ("How to monitor or visualize memory fragmentation of a delphi application") keeps a list of all allocations which can be queried at run time (and displayed in a grid using the included demo application). It does not exactly show which object leaks, as the statistics are per block size. But it can be useful for long-time monitoring of applications in production, for example servers or services. I am currently integrating it in a (commercial) web application server framework as the 'VisualMM' add-on.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
What Delphi coding standards document(s) do you follow?
Our company is looking at putting some better coding standards in place, to improve our code’s readability, reviewability, and maintainability. We’ve come across CodeGear’s “Object Pascal Style Guide”, but it hasn’t been touched in quite a while and I imagine a number of people have made some local improvements or additions. I’ve come across some published variations and other documents, which I will list, below.
NB: I do not want to start a style war. I just want to know what standards you follow, and why.
Thanks.
UPDATE: Well, the "JCL Delphi Language Style Guide" seems to be the clear winner! Thanks!
Project JEDI Delphi Language Style Guide With JCL Additions
(An extension of CodeGear’s “Object Pascal Style Guide”)
https://wiki.delphi-jedi.org/wiki/Project_JEDI_Delphi_Language_Style_Guide
(Thanks to Jeroen Pluimers and AmigoJack for reporting that the old links had died.
And in case this latest link also dies, here's its Internet Archive link, for good measure.)
CodeGear’s “Object Pascal Style Guide”
http://edn.embarcadero.com/article/10280
Econos – Coding Standard Document
(Subtitled “Delphi 4 Developer's Guide Coding Standards Document”.)
http://www.econos.de/delphi/cs.html
About.com’s “Delphi Identifier Naming Conventions”
http://delphi.about.com/od/standards/l/bldnc.htm (via Wayback Machine)
It really doesn't matter as long as you pick one and stick to it. A coding standard is like a dialect, and as long as everyone on the team speaks the same dialect, you're fine.
That said, why not pick the same standard as your runtime library (VCL) and documentation use? Then you will all be speaking the same dialect and you will have an easier time reading the runtime library code. And there are plenty of code examples to illustrate coding conventions.
There can be a tendency to over-engineer coding standards to the point where they get in the way of writing code.
I agree with Jozz’s comment. You can look at all the recommended standards, pick one and force it upon your coders or you can get your team involved in the process.
In my experience, the best way to get a team engaged is to have the team come up with the idea and the benefits of adoption. Your existing talent is your best resource. Likewise, they can be your ultimate enemy if you force them down a path they don’t buy into.
So, take a look at your existing coding variants and get the team together for some vibrant discussions on:
The reasons for adopting a coding standard.
Essential considerations in standardization.
Surfacing any insecurities in the team surrounding this issue.
Finding a point of agreement. What's important and what's not.
Establishing some corporate objectives so everyone feels like they are working towards a common goal.
Get the team to sell the benefits of standardization to themselves.
The most important objective must be to establish a ‘standard’ that best serves your team and your company.
For some inane historical reason, the coding standard at my work is to have all keywords in uppercase, in both delphi and sql. Thank god for caps lock.
CodeGear’s “Hungarian peanut butter”, for naming identifiers
http://dn.codegear.com/article/27983