bo0liu / as3-commons

Automatically exported from code.google.com/p/as3-commons
0 stars 0 forks source link

FlexLogTarget fails with USE_STACKTRACE and directlogger due to illegal characters in category name #114

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

      USE_STACKTRACE = true;
      LOGGER_FACTORY.setup = new SimpleTargetSetup(new FlexLogTarget());
      info('test!');

What is the expected output? What do you see instead?

Expect log output, instead you get exception:
Categories can not contain any of the following characters: 
[]`~,!@#$%*^&()]{}+=|';?><./".

What version of the product are you using? On what operating system?
as3commons-logging-2.7

Please provide any additional information below.

Other than not using USE_STACKTRACE in your Flex Log debugging, here is my 
simple workaround/fix:
In FlexLogTarget, add this line at the start of log() function to replace all 
invalid FlexLog characters with valid dot in category name:

      name = name.replace(/[\[\]\~\$\^\&\\(\)\{\}\+\?\/=`!@#%,:;'"<>\s]/g, '.');

Original issue reported on code.google.com by will.jor...@gmail.com on 18 Jan 2012 at 11:25

GoogleCodeExporter commented 9 years ago
Thanks for reporting that bug. The solution actually looks very reasonable. I 
am not so confident about the "." though as it is used for package separation 
where-else "@" separates a name relationship. I will look into into within a 
week, I am pretty busy right now, I hope that is okay.

yours
Martin Heidegger

Original comment by martin.h...@gmail.com on 19 Jan 2012 at 5:10

GoogleCodeExporter commented 9 years ago
Will be fixed in next version (unfortunately that will take a while)

Original comment by martin.h...@gmail.com on 20 Mar 2012 at 11:54