Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 856F493EE for ; Thu, 19 Jan 2012 17:38:18 +0000 (UTC) Received: (qmail 46880 invoked by uid 500); 19 Jan 2012 17:38:18 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 46843 invoked by uid 500); 19 Jan 2012 17:38:17 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 46835 invoked by uid 99); 19 Jan 2012 17:38:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2012 17:38:17 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [80.237.132.80] (HELO wp073.webpack.hosteurope.de) (80.237.132.80) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2012 17:38:08 +0000 Received: from p4aa831.osaknt01.ap.so-net.ne.jp ([120.74.168.49] helo=[192.168.1.21]); authenticated by wp073.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1Rnvvn-0000t4-JD; Thu, 19 Jan 2012 18:37:48 +0100 Message-ID: <4F1854DE.8010204@leichtgewicht.at> Date: Fri, 20 Jan 2012 02:37:34 +0900 From: Martin Heidegger User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: flex-dev@incubator.apache.org Subject: Trace & Log Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;mh@leichtgewicht.at;1326994688;7228f65b; X-Virus-Checked: Checked by ClamAV on apache.org Hello dear mailinglist, I have been tinkering and thinking and working on logging for quite a while now. Comparing it to other systems there is a big issue with logging in flash that could be dealt with elegantly by the compiler: Location. Many people in fact use logging systems just have some sort of orientation as to where their trace statements are. In many systems (including Flex logging system) you'd have to write things like getLogger("...") to create a location-like identifier that is somewhat performing fast. This approach lacks the method name and line number of that log statement. Now: you could work around that creating errors to get the line number but that is a _lot_ of overhead (creating an error object and analyzing the stack-trace for every trace statement). Well, as its a legacy method I suggest to create a compiler feature that passes the file and line-number or any other property to a method using meta-data. [Inject(param="file", value="caller.file.uri")] [Inject(param="lineNumber", value="caller.file.line")] function log(message: String, file:String, lineNumber: uint) {} now if somewhere we have code like: log("hello world"); the compiler automatically fills the other strings with the meta information of this logging point. This way logging systems could efficiently use the files location and maybe a lot of other information about the caller like f.ex. the describeType result for the caller. What do you think about this approach? Would you be interested in something like that? Maybe you know of other use cases where this might proof useful? yours Martin