You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Martin Heidegger <mh...@leichtgewicht.at> on 2012/01/19 18:37:34 UTC
Trace & Log
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
Re: Trace & Log
Posted by Omar Gonzalez <om...@gmail.com>.
I would suggest we wait a little bit to get our hands on Monocle and the
APIs that drive it to revisit trace() and logging. There is a ton of data
in Monocle that can be seen from the demos, and who knows how much more is
available under the hood that hasn't made it into GUIs yet.
-omar
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 05:02, Martin Heidegger wrote:
> 3) granulate by using a error and analyzing the stack trace. Which is
> obviously
very slow.
Re: Trace & Log
Posted by saurabh jain <ja...@gmail.com>.
How about introducing a framework level flag, say logLevel / logType, and
framwork users setting this depending upon what should be logged. The
setting for this could be done once and the logger class reading framework
level flag and works accordingly.
Thanks,
Saurabh
On Fri, Jan 20, 2012 at 12:07 PM, Martin Heidegger <mh...@leichtgewicht.at>wrote:
> On 20/01/2012 15:29, saurabh jain wrote:
>
>> 1. Have a compiler flag
>>
> Compiler flag works at compile time. This is not acceptable for frameworks
> (as they get deployed with a swc usually). Aside from that logging does
> have (plenty of) usecases after deployment!
>
>
> 2. Implement something like :
>> Log("message", appendAdditionalInformation);
>>
> That was the problem I was talking about: The additional informations
> needed to be passed in by hand. This is not just a lot of work, it is also
> prone to errors and people tend to "forget it".
>
> yours
> Martin.
>
--
Regards,
Saurabh
+91 80991-91166
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 15:29, saurabh jain wrote:
> 1. Have a compiler flag
Compiler flag works at compile time. This is not acceptable for
frameworks (as they get deployed with a swc usually). Aside from that
logging does have (plenty of) usecases after deployment!
> 2. Implement something like :
> Log("message", appendAdditionalInformation);
That was the problem I was talking about: The additional informations
needed to be passed in by hand. This is not just a lot of work, it is
also prone to errors and people tend to "forget it".
yours
Martin.
Re: Trace & Log
Posted by saurabh jain <ja...@gmail.com>.
Just speaking out loud:
One of the options for having logging in your application but still not
bloating your release version swf could be:
1. Have a compiler flag
2. Implement something like :
Log("message", appendAdditionalInformation);
Or may be working with two flags:
1. appendAdditionalInformationOnlyWhenDebug
2. appendAdditionalInformationAlways
With second method, you can eliminate the unnecessary debug information.
Thanks,
Saurabh
On Fri, Jan 20, 2012 at 8:39 AM, Martin Heidegger <mh...@leichtgewicht.at>wrote:
> If I wanted to profile my application I would use a profiler. However,
> Logging can be used for profiling but is just one of various use-cases and
> its not a important one. If you wish I could list the others, but in short:
>
> Basically its three things I _want_ to change:
> 1) Doing what logging does, just more _granular_. Granulate to methods or
> files.
> 2) Doing what logging does, just with _less coding_ for the _user_.
> Granulate without currently needed boilerplate code.
> 3) Doing what logging does, just more _verbose_. Show where the
> particular log statements have been originating from.
>
> The granularity is important if someone has long files, I am thinking of
> the UIComponent example right now.
>
> The verbosity (line number and location) is very important for bug
> tracking or code functionality understanding.
>
> The simplicity is very important for developers who dislike to write a lot
> of boilerplate code.
>
> I, as well as others, have tried to implement it with currently available
> features but those three problems still exist. A solution to all this would
> be the mentioned approach of compile-time-data-injection.
>
> yours
> Martin.
>
>
> On 20/01/2012 06:53, Roland Zwaga wrote:
>
>> I'm still looking for the use case. Do you just want release player
>>> performance profiling?
>>>
>>
>> I believe there is a bit of cognitive dissonance here, I see Martin
>> talking
>> about logging and a lot
>> of people chiming in about profiling, clearly these two things are
>> different beasts.
>> Sure, logging can be used for profiling, but that's just one use case for
>> logging.
>> A release version of an application can still contain logging, not all
>> logging uses trace() as its
>> target as you all might know. Having solid logging in your application is
>> important in the case
>> of application errors or perhaps even usage statistics etc.
>>
>> Martin, am I wording this right?
>>
>> cheers,
>>
>> Roland
>>
>>
>
--
Regards,
Saurabh
+91 80991-91166
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 17:18, saurabh jain wrote:
> Ok. So here what I can think of it on a single go. 1. Have a list of
> predefined values/constants which let us determine what all log
> options are available. Lets say "RecordDetails", "RecordMessagesOnly",
> "RecordCallHierarchy", etc
The problem is that RecordDetails are not available, at least not on all
platforms not in an acceptable way.
yours
Martin.
Re: Trace & Log
Posted by saurabh jain <ja...@gmail.com>.
On Fri, Jan 20, 2012 at 1:21 PM, Martin Heidegger <mh...@leichtgewicht.at>wrote:
> setLogType(Framework.**RecordDetails);
>>
> How would you implement this method? As its a method it seems to be a
> runtime switch (logic to be changed during runtime). The problem is that
> this data is not available during runtime at first place. Might be I see
> this wrong.
>
> yours
> Martin.
>
Ok. So here what I can think of it on a single go.
1. Have a list of predefined values/constants which let us determine
what all log options are available. Lets say "RecordDetails",
"RecordMessagesOnly", "RecordCallHierarchy", etc
2. setLogType will be a framework method which will accept one on the
constants defined above and set a variable for the active log type.
3. The method for log() will use this active log type variable and based
on it will perform the action.
May be there can be better way to do this. Any other ideas from community??
--
Regards,
Saurabh
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
> setLogType(Framework.RecordDetails);
How would you implement this method? As its a method it seems to be a
runtime switch (logic to be changed during runtime). The problem is that
this data is not available during runtime at first place. Might be I see
this wrong.
yours
Martin.
Re: Trace & Log
Posted by saurabh jain <ja...@gmail.com>.
>
> On 20/01/2012 15:44, saurabh jain wrote:
>
>> How about introducing a framework level flag, say logLevel / logType, and
>> framwork users setting this depending upon what should be logged. The
>> setting for this could be done once and the logger class reading framework
>> level flag and works accordingly.
>>
> Again: It is about granularity. The framework users would need to enter a
> lot of data to have it more granular. Aside from offering this ability. The
> compiler sits right now on this information.
>
> yours
> Martin.
>
>
>
Ok. Essentially with I meant was something like this:
setLogType(Framework.RecordDetails);
Log("message")
In another version one can have:
setLogType(Framework.RecordOnlyMessage);
Log("message")
With this the framework user needs to set the log type only once and need
not enter lot of data but just the required log message. No need to have
compiler option in this case.
--
Regards,
Saurabh
RE: Trace & Log
Posted by Alex Harui <ah...@adobe.com>.
> -----Original Message-----
> From: Martin Heidegger [mailto:mh@leichtgewicht.at]
> Sent: Wednesday, January 25, 2012 12:53 AM
> To: flex-dev@incubator.apache.org
> Subject: Re: Trace & Log
>
> Hey there,
>
> I just took a little time and ran some tests with flash.trace.Trace. It
> is not
> suitable for logging because it doesn't reveal how far down the rabbit
> hole
> (stack) the method has been called from, ergo: we cant find out which
> method called logging. And even if it would have: Having no runtime
> support is also a dealbreaker and the chances are high that it would
> have been slower if you used this method for every call rather than a
> exception just for the logging calls.
>
> http://www.leichtgewicht.at/862/flash-trace-trace-in-depth/
>
> yours
> Martin.
>
My tracing profiler prototype uses a Error to get a starting stack trace.
I agree the callback can degrade performance. The question for me is what penalty, if any, we want to impose on the way we write our code or the output SWF for the low-probability but high-value of debugging a problem in the wild.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
Hey there,
I just took a little time and ran some tests with flash.trace.Trace. It
is not
suitable for logging because it doesn't reveal how far down the rabbit hole
(stack) the method has been called from, ergo: we cant find out which
method called logging. And even if it would have: Having no runtime
support is also a dealbreaker and the chances are high that it would
have been slower if you used this method for every call rather than a
exception just for the logging calls.
http://www.leichtgewicht.at/862/flash-trace-trace-in-depth/
yours
Martin.
On 20/01/2012 23:43, Dirk Eismann wrote:
> I just researched the flash.trace.Trace class Alex mentioned and found
>
> http://blog.sangupta.com/2011/08/magic-of-flashtracetrace.html
>
> which was blogged by Sandeep (who is on this list as well).
>
> A quite interesting (undoc'ed) feature that might be handy but I guess
> this is a debug runtime / debug build feature only.
>
> Dirk.
>
> 2012/1/20 Dirk Eismann<bo...@googlemail.com>:
>> I like the idea. I often wished we had logging capabilities for
>> release version SWFs running in release players that are similar to
>> what e.g.. log4j offers for Java applications (the reason it works in
>> Java is that javac by default always compiles debug information for
>> source files and line numbers into class files. They have no concept
>> of a "release build" vs. a "debug build". Different VM, different
>> features)
>>
>> The use case Martin describes (error only happening in release player
>> or only on specific machine configurations usually at the end user /
>> customer) sounds too familiar. The way I handled this was to add some
>> self crafted logging that accumulates log information and on demand
>> sends them away using http... not nice, but works. But it also could
>> be so much better.
>>
>> So I definitely would like to see these logging features Martin
>> sketched up and would be happy to help out.
>>
>> Dirk.
>
Re: Trace & Log
Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> I'm afraid that will be the case as well. Interestingly, there's also
> a flag to set Trace to log to a file instead of rounting to a
> listerner.
>
I hadn't spotted that one yet, that's pretty cool, with the amount that
this functionality can output
it is certainly handy to be able to dump this straight to a file, cool!
> > Anyhow, I still agree with you that the compiler metrics you mention in
> > your initial post could be beneficial to expose to actionscript.
> > I'm looking forward to reading about your tests :)
>
> me too, And as I mentioned, I'm willing to help out and try to get 1st
> class, non-intrusive, smooth performing logging into the SDK.
>
Thanks for the support Dirk! :)
--
regards,
Roland
--
Roland Zwaga
Senior Consultant | Stack & Heap BVBA
+32 (0)486 16 12 62 | roland@stackandheap.com | http://www.stackandheap.com
Re: Trace & Log
Posted by Dirk Eismann <bo...@googlemail.com>.
2012/1/20 Roland Zwaga <ro...@stackandheap.com>:
> Also, quite probably, this will only work in a debug build. But that's also
> something you will test for I guess.
I'm afraid that will be the case as well. Interestingly, there's also
a flag to set Trace to log to a file instead of rounting to a
listerner.
> Anyhow, I still agree with you that the compiler metrics you mention in
> your initial post could be beneficial to expose to actionscript.
> I'm looking forward to reading about your tests :)
me too, And as I mentioned, I'm willing to help out and try to get 1st
class, non-intrusive, smooth performing logging into the SDK.
Dirk.
Re: Trace & Log
Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> First off: THANK YOU! I completely missed out on this feature. It seems
> already doing half of the job necessary.
> I will take a quiet hour on the weekend to investigate int
> version/platform availability.
>
> But, Just half of the job means:
> It seems as if the arguments get converted to a string which would be a
> no-go. The line number is a good thing, but
> the container type would be a more helpful for proper and consistent
> filtering. Also it is not possible to implement a "isEnabled" flag, which
> is essential for logging in big systems.
>
> To sum it up: Nice thing, I will definitely get into it, but from what I
> can judge right now, it is not enough to implement a clean, fast logging.
>
Also, quite probably, this will only work in a debug build. But that's also
something you will test for I guess.
Anyhow, I still agree with you that the compiler metrics you mention in
your initial post could be beneficial to expose to actionscript.
I'm looking forward to reading about your tests :)
cheers,
Roland
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
First off: THANK YOU! I completely missed out on this feature. It seems
already doing half of the job necessary.
I will take a quiet hour on the weekend to investigate int
version/platform availability.
But, Just half of the job means:
It seems as if the arguments get converted to a string which would be a
no-go. The line number is a good thing, but
the container type would be a more helpful for proper and consistent
filtering. Also it is not possible to implement a "isEnabled" flag,
which is essential for logging in big systems.
To sum it up: Nice thing, I will definitely get into it, but from what I
can judge right now, it is not enough to implement a clean, fast logging.
yours
Martin.
On 20/01/2012 23:43, Dirk Eismann wrote:
> I just researched the flash.trace.Trace class Alex mentioned and found
>
> http://blog.sangupta.com/2011/08/magic-of-flashtracetrace.html
>
> which was blogged by Sandeep (who is on this list as well).
>
> A quite interesting (undoc'ed) feature that might be handy but I guess
> this is a debug runtime / debug build feature only.
>
> Dirk.
>
> 2012/1/20 Dirk Eismann<bo...@googlemail.com>:
>> I like the idea. I often wished we had logging capabilities for
>> release version SWFs running in release players that are similar to
>> what e.g.. log4j offers for Java applications (the reason it works in
>> Java is that javac by default always compiles debug information for
>> source files and line numbers into class files. They have no concept
>> of a "release build" vs. a "debug build". Different VM, different
>> features)
>>
>> The use case Martin describes (error only happening in release player
>> or only on specific machine configurations usually at the end user /
>> customer) sounds too familiar. The way I handled this was to add some
>> self crafted logging that accumulates log information and on demand
>> sends them away using http... not nice, but works. But it also could
>> be so much better.
>>
>> So I definitely would like to see these logging features Martin
>> sketched up and would be happy to help out.
>>
>> Dirk.
Re: Trace & Log
Posted by Dirk Eismann <bo...@googlemail.com>.
I just researched the flash.trace.Trace class Alex mentioned and found
http://blog.sangupta.com/2011/08/magic-of-flashtracetrace.html
which was blogged by Sandeep (who is on this list as well).
A quite interesting (undoc'ed) feature that might be handy but I guess
this is a debug runtime / debug build feature only.
Dirk.
2012/1/20 Dirk Eismann <bo...@googlemail.com>:
> I like the idea. I often wished we had logging capabilities for
> release version SWFs running in release players that are similar to
> what e.g.. log4j offers for Java applications (the reason it works in
> Java is that javac by default always compiles debug information for
> source files and line numbers into class files. They have no concept
> of a "release build" vs. a "debug build". Different VM, different
> features)
>
> The use case Martin describes (error only happening in release player
> or only on specific machine configurations usually at the end user /
> customer) sounds too familiar. The way I handled this was to add some
> self crafted logging that accumulates log information and on demand
> sends them away using http... not nice, but works. But it also could
> be so much better.
>
> So I definitely would like to see these logging features Martin
> sketched up and would be happy to help out.
>
> Dirk.
Re: Trace & Log
Posted by Dirk Eismann <bo...@googlemail.com>.
I like the idea. I often wished we had logging capabilities for
release version SWFs running in release players that are similar to
what e.g.. log4j offers for Java applications (the reason it works in
Java is that javac by default always compiles debug information for
source files and line numbers into class files. They have no concept
of a "release build" vs. a "debug build". Different VM, different
features)
The use case Martin describes (error only happening in release player
or only on specific machine configurations usually at the end user /
customer) sounds too familiar. The way I handled this was to add some
self crafted logging that accumulates log information and on demand
sends them away using http... not nice, but works. But it also could
be so much better.
So I definitely would like to see these logging features Martin
sketched up and would be happy to help out.
Dirk.
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 15:42, Alex Harui wrote:
> I'm still lost. That is a description of what you want to do, but not why.
I am seriously starting to doubt my english skills. Okay: My "why" is a
simple pursuit of excellency. I am not happy with the overhead of
current logging systems. After evaluating all options I think this
(compiler-injection) would be the best solution to solve my unhappiness
with the current options(listed in my former mails) to implement a
logging system. The solution might also be useful for other
applications, even though I am not knee-deep into them, that is why I am
posting this idea here.
> If not profiling, what do you want to know about the framework code that
> requires a release player?
"requires a release player" is a odd choice of words. Wouldn't it be
clearer as "doesn't require a debug player"?
Anyways: A use case is sending the log statements produced in a deployed
swf running in on a clients computer with the release player back-home
(to the developer) if a error occurs. Improved error debugging!
Another point is that sometimes (more often than appreciated or
anticipated) errors do just occur in the release player but not in the
debug player. Its a side-effect of compile time flags and debugging
specific code. Some people use log statements just to fix these sort of
bugs or to never run into them.
> A debug SWF has file and line number information in it. Would it be sufficient to simply remove some of that information so it only has information at method entry points?
Debug SWFs have line number information that are readable by the flash
player. And as far as I know they are not accessible without a
stack-trace from a error running in a debug player. Also: deployed swfs
are stripped of that information. The stripping is good, it makes the
swf lighter. With the suggested implementation there would be a way to
selectively enable to keep the information and pass it directly just
where they are needed.
On 20/01/2012 15:44, saurabh jain wrote:
> How about introducing a framework level flag, say logLevel / logType, and
> framwork users setting this depending upon what should be logged. The
> setting for this could be done once and the logger class reading framework
> level flag and works accordingly.
Again: It is about granularity. The framework users would need to enter
a lot of data to have it more granular. Aside from offering this
ability. The compiler sits right now on this information.
yours
Martin.
Re: Trace & Log
Posted by Alex Harui <ah...@adobe.com>.
On 1/19/12 7:09 PM, "Martin Heidegger" <mh...@leichtgewicht.at> wrote:
> If I wanted to profile my application I would use a profiler. However,
> Logging can be used for profiling but is just one of various use-cases
> and its not a important one. If you wish I could list the others, but in
> short:
>
> Basically its three things I _want_ to change:
> 1) Doing what logging does, just more _granular_. Granulate to methods
> or files.
> 2) Doing what logging does, just with _less coding_ for the _user_.
> Granulate without currently needed boilerplate code.
> 3) Doing what logging does, just more _verbose_. Show where the
> particular log statements have been originating from.
>
I'm still lost. That is a description of what you want to do, but not why.
If not profiling, what do you want to know about the framework code that
requires a release player?
A debug SWF has file and line number information in it. Would it be
sufficient to simply remove some of that information so it only has
information at method entry points?
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
If I wanted to profile my application I would use a profiler. However,
Logging can be used for profiling but is just one of various use-cases
and its not a important one. If you wish I could list the others, but in
short:
Basically its three things I _want_ to change:
1) Doing what logging does, just more _granular_. Granulate to methods
or files.
2) Doing what logging does, just with _less coding_ for the _user_.
Granulate without currently needed boilerplate code.
3) Doing what logging does, just more _verbose_. Show where the
particular log statements have been originating from.
The granularity is important if someone has long files, I am thinking of
the UIComponent example right now.
The verbosity (line number and location) is very important for bug
tracking or code functionality understanding.
The simplicity is very important for developers who dislike to write a
lot of boilerplate code.
I, as well as others, have tried to implement it with currently
available features but those three problems still exist. A solution to
all this would be the mentioned approach of compile-time-data-injection.
yours
Martin.
On 20/01/2012 06:53, Roland Zwaga wrote:
>> I'm still looking for the use case. Do you just want release player
>> performance profiling?
>
> I believe there is a bit of cognitive dissonance here, I see Martin talking
> about logging and a lot
> of people chiming in about profiling, clearly these two things are
> different beasts.
> Sure, logging can be used for profiling, but that's just one use case for
> logging.
> A release version of an application can still contain logging, not all
> logging uses trace() as its
> target as you all might know. Having solid logging in your application is
> important in the case
> of application errors or perhaps even usage statistics etc.
>
> Martin, am I wording this right?
>
> cheers,
>
> Roland
>
Re: Trace & Log
Posted by Roland Zwaga <ro...@stackandheap.com>.
>
> I'm still looking for the use case. Do you just want release player
> performance profiling?
I believe there is a bit of cognitive dissonance here, I see Martin talking
about logging and a lot
of people chiming in about profiling, clearly these two things are
different beasts.
Sure, logging can be used for profiling, but that's just one use case for
logging.
A release version of an application can still contain logging, not all
logging uses trace() as its
target as you all might know. Having solid logging in your application is
important in the case
of application errors or perhaps even usage statistics etc.
Martin, am I wording this right?
cheers,
Roland
Re: Trace & Log
Posted by Alex Harui <ah...@adobe.com>.
On 1/19/12 12:02 PM, "Martin Heidegger" <mh...@leichtgewicht.at> wrote:
>
> On 20/01/2012 04:32, Alex Harui wrote:
>
> The injection of data that is fixed from the time of compilation (not
> before) is a reasonable thing to be added to a compiler. Why? Because it
> bloats code a lot more if it has to be by hand (seeing all the log =
> Log.getLogger() statements). In general I think AS3 can become a
> thinner, faster and easier to use language with this construct, as any
> workaround to the problematic of compilation data results in a lot of code.
I'm still looking for the use case. Do you just want release player
performance profiling?
I would think these kinds of compiler features would run into the "library
problem". Right now, for compilation speed, the framework is compiled into
a SWC. Would you have this extra code in the SWC or not? If not, then do
you ship two versions of the SWC? And then, when someone wants to do
another compiler feature, do you add more libraries for each combination?
If you start packing all of this stuff into one library, the default SWC is
fat and slow. You can ask a post-link optimizer to clean out what you don't
want, but that also slows down compilation time.
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 04:32, Alex Harui wrote:
> Martin, what problem or problems are you trying to solve?
> My long-term thoughts on logging was that if the framework was more granular, you would swap in
> loggable versions of the granules when and where you needed them.
I guess I repeat myself but however: The problem is that you have to
identify which granules are which. Right now we have 3 options:
1) retrieve a logger instance with getLogger(category) that granulates
on class basis. Its obvious that this granulation can only granulate to
the class level not per level method.
2) granulate by asking the user to provide it on each statement, this is
tedious and users simply skip it.
log("my message", "com.mypackage.MyClass");
3) granulate by using a error and analyzing the stack trace. Which is
obviously
function log() {
if( debug_player ) {
var e: Error = new Error();
// get granule by stacktrace, just works in debug player, just works
}
}
Now: if we had the compiler injected data of the callers location (file
and line number) we could granulate very fast with a lookup and/or a
simple string operation. Down to the method level, which important for
bug tracking. And to top it all off, it would work in
non-debug-players. As simple as a trace statement but as powerful as
complex logging.
> In general, I don't like code baked even if it has a minimal cost.Eventually it all adds up. And I don't like littering code with metadata.
The injection of data that is fixed from the time of compilation (not
before) is a reasonable thing to be added to a compiler. Why? Because it
bloats code a lot more if it has to be by hand (seeing all the log =
Log.getLogger() statements). In general I think AS3 can become a
thinner, faster and easier to use language with this construct, as any
workaround to the problematic of compilation data results in a lot of code.
yours
Martin.
Re: Trace & Log
Posted by Alex Harui <ah...@adobe.com>.
Martin, what problem or problems are you trying to solve? In general, I
don't like code baked even if it has a minimal cost. Eventually it all adds
up. And I don't like littering code with metadata. My long-term thoughts
on logging was that if the framework was more granular, you would swap in
loggable versions of the granules when and where you needed them.
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
I am currently okay with using 0.05 nanoseconds (not milli) for a unused
logging call (current state of performance). I am sure that monocle is
fast. But I am not sure if a callback loop to AS3 would be (even if it
might be available). And even if it would be fast, it could not be
faster than implementing a compile-time logic (as was elaborated by
adobe in their falcon blog post yesterday) as compile time is hardly
beatable.
Essentially I am proposing a system that allows compile-time filling of
blanks in the code by things the compiler might know. Especially
important for me are name and location of the caller of a method. I can
imagine other things the compiler knows of might be important for other
usages to:
XML description as provided by describeType;
class MyClass {
[Fill(data="container.xml")]
private static const asDescribed:XML;
}
For IOC it might be a high-performant way to combine that by using:
[Fill(arg="typeInfo", data="caller.type.xml")]
[Fill(arg="constr", data="caller.type.constructor")]
public function createInstance(constr:Function, typeInfo:XML) {}
Maybe the compiler flags or other compilation data might be interesting:
[Fill(data="compilation.flags")]
private static const flags:Vector.<String>;
[Fill(data="compilation.time")]
private static const compiledAt:Date;
Or maybe even custom arguments like the time when this was compiled
[Fill(data="compilation.arg.user")]
private static const compiledBy:String;
That are just some idea I have had for that. I think it would help
creating high-performance applications, especially important for mobile.
And we might not be that limited when its up to logging solutions. Some
questions still bug me:
*) How should this be named? (auto-fill, compiler-data,..)
*) What applications could that have? Is it interesting for IOC?
*) How to implement that? I would need a compiler crash-course. Are
there members who could provide mentoring?
yours
Martin.
On 20/01/2012 03:28, Omar Gonzalez wrote:
> There is an incredible amount of data being passed from applications into
> Monocle at what appears to be an extremely fast clip. I can't speak to what
> methods they're using to accomplish that, but the speed is extraordinarily
> fast for as much data as there has been in the demos. Have you looked at
> the video? There is a lot of information _per frame run_ with highly
> detailed information about what is running, how long it took, the phases of
> the frame in which it occurred and other things that they still have not
> demo'd publicly.
>
> Either way, you're free to work on whatever you want, as is the "Apache
> way", I'm just letting you know of what's coming on the horizon as it might
> influence your decision, or you may not care and just do it anyway, that's
> your call! :)
>
> -omar
>
Re: Trace & Log
Posted by Omar Gonzalez <om...@gmail.com>.
There is an incredible amount of data being passed from applications into
Monocle at what appears to be an extremely fast clip. I can't speak to what
methods they're using to accomplish that, but the speed is extraordinarily
fast for as much data as there has been in the demos. Have you looked at
the video? There is a lot of information _per frame run_ with highly
detailed information about what is running, how long it took, the phases of
the frame in which it occurred and other things that they still have not
demo'd publicly.
Either way, you're free to work on whatever you want, as is the "Apache
way", I'm just letting you know of what's coming on the horizon as it might
influence your decision, or you may not care and just do it anyway, that's
your call! :)
-omar
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 03:04, Omar Gonzalez wrote:
> Actually that is not correct, and I'm not sure how much detail I can
> currently share but I can tell you with certainty that what you said is not
> correct.
>
> -omar
Okay, so we are tip-toeing around clear words. I assume I am entirely
right that you need at least a new player (not FP 11.1) for it to run. I
could think that this needs to be a debug player but I guessed too much
before.
The compiler feature could be backwards compatible (to flash player 9)
and this is important to me. Also things done at compile time save
performance during runtime, no matter how fast Monocle will be: It needs
some sort of mechanism that must be slower than just passing strings.
yours
Martin.
Re: Trace & Log
Posted by Omar Gonzalez <om...@gmail.com>.
Actually that is not correct, and I'm not sure how much detail I can
currently share but I can tell you with certainty that what you said is not
correct.
-omar
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
Oh, thanks for reminding! As far as I understand monocle has to be
"activated" by the user of the flash player. This is not an option for
some applications of logging. So, I think the discussion can get started
without waiting.
yours
Martin.
On 20/01/2012 02:55, Arnoud Bos wrote:
> Monocle gives you real time data about your running flash instance.
>
> this is an interesting sneak about it:
> http://www.youtube.com/watch?v=yLECXpF1cUg
>
> Arnoud
>
> On Jan 19, 2012, at 6:51 PM, Martin Heidegger wrote:
>
>> On 20/01/2012 02:40, Omar Gonzalez wrote:
>>> I would suggest we wait a little bit to get our hands on Monocle and the
>>> APIs that drive it to revisit trace() and logging. There is a ton of data
>>> in Monocle that can be seen from the demos, and who knows how much more is
>>> available under the hood that hasn't made it into GUIs yet.
>>>
>>> -omar
>> Sorry for being a little uneducated but: What is monocle?
>>
>> On 20/01/2012 02:45, Skogen, Espen wrote:
>>> Hmm, haven't really had much thought on the concept itself, but we shouldn't use [Inject] as this would conflict with a number of IOC frameworks.
>>>
>> Okay: Lets keep the naming issue in mind :)
>>
>> yours
>> Martin.
>>
> Met vriendelijke groet,
>
> Arnoud Bos
> Artim interactive
>
> E arnoud@artim-interactive.nl
> W www.artim-interactive.nl
> T +31 6 246 40 216
> A Elisabeth Wolffstraat 77-3
> 1053TT Amsterdam
>
>
>
>
>
Re: Trace & Log
Posted by Alex Harui <ah...@adobe.com>.
On 1/19/12 9:55 AM, "Arnoud Bos" <ar...@artim-interactive.nl> wrote:
> Monocle gives you real time data about your running flash instance.
BTW, there is a semi-documented feature flash.trace.Trace (different from
the trace() method). It essentially allows the building of tracing
profilers (as opposed to sampling profilers). I have a prototype and have
used it to diagnose various issues. There are some flaws that need fixing
before it can be a real tool. I think monocle might be using it.
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui
Re: Trace & Log
Posted by Arnoud Bos <ar...@artim-interactive.nl>.
Monocle gives you real time data about your running flash instance.
this is an interesting sneak about it:
http://www.youtube.com/watch?v=yLECXpF1cUg
Arnoud
On Jan 19, 2012, at 6:51 PM, Martin Heidegger wrote:
> On 20/01/2012 02:40, Omar Gonzalez wrote:
>> I would suggest we wait a little bit to get our hands on Monocle and the
>> APIs that drive it to revisit trace() and logging. There is a ton of data
>> in Monocle that can be seen from the demos, and who knows how much more is
>> available under the hood that hasn't made it into GUIs yet.
>>
>> -omar
> Sorry for being a little uneducated but: What is monocle?
>
> On 20/01/2012 02:45, Skogen, Espen wrote:
>> Hmm, haven't really had much thought on the concept itself, but we shouldn't use [Inject] as this would conflict with a number of IOC frameworks.
>>
> Okay: Lets keep the naming issue in mind :)
>
> yours
> Martin.
>
Met vriendelijke groet,
Arnoud Bos
Artim interactive
E arnoud@artim-interactive.nl
W www.artim-interactive.nl
T +31 6 246 40 216
A Elisabeth Wolffstraat 77-3
1053TT Amsterdam
Re: Trace & Log
Posted by Petr Cihelka <ci...@xhost.cz>.
Hi,
here is some info about Monocle (by Deepa)
http://tv.adobe.com/watch/max-2011-sneak-peeks/max-2011-sneak-peek-monocle/
--
Peter.
Dne 19.1.2012 18:51, Martin Heidegger napsal(a):
> On 20/01/2012 02:40, Omar Gonzalez wrote:
>> I would suggest we wait a little bit to get our hands on Monocle and the
>> APIs that drive it to revisit trace() and logging. There is a ton of data
>> in Monocle that can be seen from the demos, and who knows how much
>> more is
>> available under the hood that hasn't made it into GUIs yet.
>>
>> -omar
> Sorry for being a little uneducated but: What is monocle?
>
> On 20/01/2012 02:45, Skogen, Espen wrote:
>> Hmm, haven't really had much thought on the concept itself, but we
>> shouldn't use [Inject] as this would conflict with a number of IOC
>> frameworks.
>>
> Okay: Lets keep the naming issue in mind :)
>
> yours
> Martin.
>
Re: Trace & Log
Posted by Martin Heidegger <mh...@leichtgewicht.at>.
On 20/01/2012 02:40, Omar Gonzalez wrote:
> I would suggest we wait a little bit to get our hands on Monocle and the
> APIs that drive it to revisit trace() and logging. There is a ton of data
> in Monocle that can be seen from the demos, and who knows how much more is
> available under the hood that hasn't made it into GUIs yet.
>
> -omar
Sorry for being a little uneducated but: What is monocle?
On 20/01/2012 02:45, Skogen, Espen wrote:
> Hmm, haven't really had much thought on the concept itself, but we shouldn't use [Inject] as this would conflict with a number of IOC frameworks.
>
Okay: Lets keep the naming issue in mind :)
yours
Martin.
RE: Trace & Log
Posted by "Skogen, Espen" <es...@jpmorgan.com>.
Hmm, haven't really had much thought on the concept itself, but we shouldn't use [Inject] as this would conflict with a number of IOC frameworks.
E:)
Espen Skogen | Vice President | IB Tech Market | Investment Bank | J.P. Morgan | 125 London Wall, EC2Y 5AJ, London, United Kingdom | T: +442077420836 | espen.skogen@jpmorgan.com | jpmorgan.com
-----Original Message-----
From: Martin Heidegger [mailto:mh@leichtgewicht.at]
Sent: 19 January 2012 17:38
To: flex-dev@incubator.apache.org
Subject: Trace & Log
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
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.