From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,86b57370403509bc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!o15g2000vbb.googlegroups.com!not-for-mail From: dhenry Newsgroups: comp.lang.ada Subject: Re: Disabling string evaluation in a logging system Date: Tue, 18 May 2010 05:18:35 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <5b94cf13-b7e7-4079-97c6-87dd03f29933@o39g2000vbd.googlegroups.com> <3d545554-3182-46df-ab96-0201eac851a9@k31g2000vbu.googlegroups.com> NNTP-Posting-Host: 80.156.46.53 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1274185115 14056 127.0.0.1 (18 May 2010 12:18:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 18 May 2010 12:18:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o15g2000vbb.googlegroups.com; posting-host=80.156.46.53; posting-account=EZVF2goAAABmd4nprEqIYBBoiiKbAL2e User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.19) Gecko/2010040116 Ubuntu/9.04 (jaunty) Firefox/3.0.19,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11721 Date: 2010-05-18T05:18:35-07:00 List-Id: Thank you for all your replies. As Dmitry said, the log level may dynamically change. Therefore, inlining in order to let the compiler do the optimization doesn't work. Neither is the "Tricky" procedure tip. The example I gave with a "parameter name" stored in an unbounded string was just an illustration of a complex string to log. But of course, it could be any variable and of any type, for a lot of different sentences, so I can't write a new procedure each time (I'd prefer writing the if-test each time). There may be no solution as I'd like. I'll prefer to let the application perform a lot of useless string conversion and concatenations rather have an optimized but heavy to use logging system. (For the moment, I don't have serious performance issues so that I would need to reduce those useless string operations).