Refactoring and enhancement to SystemLog Extension. #22

Merged
merged 6 commits into from Jul 13, 2012

Projects

None yet

5 participants

@muerl
Contributor
muerl commented Nov 23, 2011

Refactored the api to follow the "Best Practices for Event Logging, so there is a "setup" and register is only called once and a "write" for actual writting
Added the ability to log to standard out in addition to event logs
Made including the library a little less clumsy
Moved code into the blackberry.ext.system namespace rather than webworks.system

@muerl muerl Rewrote the logging so that it follows best practice for using the lo…
…gging

APIs
Added the ability to log to standard out in addition to event logs
TODO:

Refactor to work the "new" way.
92004c1
@jeffheifetz
Contributor

Unless you have a compelling reason I'd rather not change the feature ID

@muerl
Contributor
muerl commented Nov 29, 2011

I changed the feature ID because it should match the JavaScript Name space, atleast I thought that it should. And I felt the JavaScript namespace was strange, All other extentions are inside - blackberry.something and not webworks.something

But I am open to removing that if its an issue.

@jeffheifetz
Contributor

The argument to keep it is largely based on people having to change their feature IDs who are already using the extension, but you've re-written the interface so I'm not sure that applies...

@jeffheifetz jeffheifetz commented on the diff Dec 2, 2011
...log/src/blackberry/system/log/SystemLogNamespace.java
+ else
+ {
+ writeToLog("blackberry.system.log", "WebWorks System Log API", "ERROR 4419 Improper API useage");
+ }
+ return UNDEFINED;
+ }
+ }
+
+ public class SetupLogging extends ScriptableFunction
+ {
+ private static final String NAME = "setup";
+ public Object invoke(Object obj, Object[] args) throws Exception
+ {
+ if (args != null && args.length == 3)
+ {
+ setupLogging(args[0].toString(), args[1].toString(), ((Integer)args[2]));
@jeffheifetz
jeffheifetz Dec 2, 2011 Contributor

Could we setup some default values, at least for the third parameter?

@jeffheifetz
Contributor

Also I love the idea of logging to multiple places. Any chance you want to implement console.log? If not I can do an update after

@muerl
Contributor
muerl commented Dec 3, 2011

So, I agree that console.log is the right way to go as well it was on initial todo.

I also will add a default.

But both will have to wait until post devcon, because I need to refactor the extension to the "new" way and make a pass at a playbook extension.

------Original Message------
From: Jeffrey Heifetz
To: Muerl
Subject: Re: [WebWorks-Community-APIs] Refactoring and enhancement to SystemLog Extension. (#22)
Sent: Dec 2, 2011 9:33 PM

Also I love the idea of logging to multiple places. Any chance you want to implement console.log? If not I can do an update after


Reply to this email directly or view it on GitHub:
#22 (comment)

Sent From Device.

@muerl
Contributor
muerl commented Dec 7, 2011

Jeff,

Is there a consensus as to code for Version 2.2, vs older code? I did a refactor to move the code to the 2.2 version, but Are we putting those changes else where?

muerl added some commits Dec 7, 2011
@muerl muerl Adding Flex. Refactor for 2.2
This was done to use the 'New Way' for supporting webworks 2.2 and avoiding
using the use of ScriptableFunction

Also this was done so that we could have 1 extention for both Tablet and
Smartphone.

Also added console.log

Considering piping it the other way as well but thats for later.
98e5b0e
@muerl muerl Support for Flash
The flash code builds now.
Also got rid of some older code.

Both sides of the code are now in Tablet, because the library.xml supports
building for BOTH.  Which rocks.
84c179f
@muerl
Contributor
muerl commented Jan 3, 2012

poke

@jeffheifetz jeffheifetz commented on the diff Jan 3, 2012
Tablet/systemlog/src/js/common/index.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
@jeffheifetz
jeffheifetz Jan 3, 2012 Contributor

What is the purpose of this file?

@muerl
muerl Jan 3, 2012 Contributor

good question.

I didn't mean to push it. Its testing for the JS api components. Its a Mock for for the BB things that the JS needed, so I could test in chrome, cause I had yet to use ripple. PS does ripple let you test custom extensions yet?

@jeffheifetz
jeffheifetz Jan 3, 2012 Contributor

I don't believe it has any special mechanism for doing so. You can of course just load a definition when in Ripple only though.

@jeffheifetz
Contributor

Just double checking that you confirm all the code to be your own.

@muerl
Contributor
muerl commented Jan 3, 2012

baring what I took from other components of WebWorks it is all my own code.

@jeffheifetz
Contributor

Sounds great to me. One last thing regarding the licenses and copyright statements. Can we make them look consistent among eachother and follow the following formatting

Also, since you signed an ILCA and CCLA, should you put a copyright notice for Pyxis as well?

/*

  • Copyright 2011-2012 Research In Motion Limited.
  • Copyright 2011-2012 Matthew Haag.
    *
  • Licensed under the Apache License, Version 2.0 (the "License");
  • you may not use this file except in compliance with the License.
  • You may obtain a copy of the License at
    *
  • http://www.apache.org/licenses/LICENSE-2.0
    *
  • Unless required by applicable law or agreed to in writing, software
  • distributed under the License is distributed on an "AS IS" BASIS,
  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • See the License for the specific language governing permissions and
  • limitations under the License.
    */
@jeffheifetz
Contributor

poke

@timwindsor
Member

So are we at a state where we can merge this now?

@muerl
Contributor
muerl commented Mar 24, 2012

Sooooo We Changed our company name, so I added some more recent copyright information.

I have one question.

The code in /smartphone is written for smartphone "the old way"

The code in /Tablet is written the new way and for both smartphone and tablet. I am not sure the right way to intermix that.

@muerl
Contributor
muerl commented Mar 24, 2012

Tim,

I want to test the Tablet Extension, I wrote the code on a machine the Tablet tool-chain would build on but would not run a sim.

The BB code is solid, the PlayBook Code I will have an answer for you by tuesday?

@muerl
Contributor
muerl commented Apr 1, 2012

Okay wrong Tuesday. This is good to go.

Can we change my company name and Logo on the contributors page though?

@pelegri
Contributor
pelegri commented Apr 2, 2012

I assume you mean Verivo?
I can't find the CA, though. And I'm not sure if we can use the one from Matthew since that was under a different name and I'm not sure how easy is it for us to document the change.
Could you and Matthew send a new one with the new name?

@muerl
Contributor
muerl commented Apr 2, 2012

I am "Matthew Haag" and "Verivo Software" IS "Pyxis Mobile" : http://www.verivo.com/press/press-releases/mobile-industry-experts-launch-verivo-software/

But if you need me to redo a CA I will pass that over to people here today.

@pelegri
Contributor
pelegri commented Apr 5, 2012

Hi Matthew - sorry didn't match name/id.
Yes, a new CA with the Verivo name would be very useful, specially since the CA we have only has your name, not Pyxis.

@muerl
Contributor
muerl commented Apr 7, 2012

So the CA is now out of my hands, I know I submitted one as Pyxis, I actually had a copy of it in my files. It will be fine.

@pelegri
Contributor
pelegri commented Apr 7, 2012

Sounds good. I'm sure we will eventually get the Verivo CA, so go ahead. Can you help me track the CA so we get it done

@astanley

Whoah, 3 months since EPL's comment. Sorry about the delay. Not sure why this one got missed! Merging (finally - yay!).

@astanley astanley merged commit 47be17c into blackberry:master Jul 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment