Bug 583829 - Log4Moz.getLogger() should always be called with a name
authorPhilipp von Weitershausen <philipp@weitershausen.de>
Mon, 02 Aug 2010 22:06:29 +0200
changeset 48774 0b8b9f147452215c5a4c59fef0c4ba1e35903b6c
parent 48773 b39aabb7bed36ec9b5df3e3d49170ec1b8444467
child 48775 ebb224739c1a8e45a8be6e1e806d9ebeb57d18e5
push id14809
push userposhannessy@mozilla.com
push dateTue, 03 Aug 2010 06:50:00 +0000
treeherdermozilla-central@51051a9791ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs583829
Bug 583829 - Log4Moz.getLogger() should always be called with a name
services/sync/tests/unit/test_records_crypto.js
services/sync/tests/unit/test_records_keys.js
--- a/services/sync/tests/unit/test_records_crypto.js
+++ b/services/sync/tests/unit/test_records_crypto.js
@@ -34,17 +34,17 @@ function crypto_meta_handler(metadata, r
              payload: JSON.stringify(cryptoMeta.payload)};
   return httpd_basic_auth_handler(JSON.stringify(obj), metadata, response);
 }
 
 function run_test() {
   let server;
 
   try {
-    let log = Log4Moz.repository.getLogger();
+    let log = Log4Moz.repository.getLogger("Test");
     Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
     log.info("Setting up server and authenticator");
 
     server = httpd_setup({"/pubkey": pubkey_handler,
                           "/privkey": privkey_handler,
                           "/crypted-resource": crypted_resource_handler,
                           "/crypto-meta": crypto_meta_handler});
--- a/services/sync/tests/unit/test_records_keys.js
+++ b/services/sync/tests/unit/test_records_keys.js
@@ -1,17 +1,13 @@
-try {
-  Cu.import("resource://services-sync/base_records/keys.js");
-  Cu.import("resource://services-sync/auth.js");
-  Cu.import("resource://services-sync/log4moz.js");
-  Cu.import("resource://services-sync/identity.js");
-  Cu.import("resource://services-sync/util.js");
-} catch (e) {
-  do_throw(e);
-}
+Cu.import("resource://services-sync/base_records/keys.js");
+Cu.import("resource://services-sync/auth.js");
+Cu.import("resource://services-sync/log4moz.js");
+Cu.import("resource://services-sync/identity.js");
+Cu.import("resource://services-sync/util.js");
 
 function pubkey_handler(metadata, response) {
   let obj = {id: "asdf-1234-asdf-1234",
              modified: "2454725.98283",
              payload: JSON.stringify({type: "pubkey",
                                    privateKeyUri: "http://localhost:8080/privkey",
                                    keyData: "asdfasdfasf..."})};
   return httpd_basic_auth_handler(JSON.stringify(obj), metadata, response);
@@ -25,17 +21,17 @@ function privkey_handler(metadata, respo
                                    keyData: "asdfasdfasf..."})};
   return httpd_basic_auth_handler(JSON.stringify(obj), metadata, response);
 }
 
 function test_get() {
   let server;
 
   try {
-    let log = Log4Moz.repository.getLogger();
+    let log = Log4Moz.repository.getLogger("Test");
     Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
     log.info("Setting up server and authenticator");
 
     server = httpd_setup({"/pubkey": pubkey_handler,
                           "/privkey": privkey_handler});
 
     let auth = new BasicAuthenticator(new Identity("secret", "guest", "guest"));
@@ -50,17 +46,16 @@ function test_get() {
     log.info("Getting matching private key");
 
     let privkey = PrivKeys.get(pubkey.privateKeyUri);
     do_check_eq(privkey.data.payload.type, "privkey");
     do_check_eq(PrivKeys.response.status, 200);
 
     log.info("Done!");
   }
-  catch (e) { do_throw(e); }
   finally { server.stop(function() {}); }
 }
 
 
 function test_createKeypair() {
   let passphrase = "moneyislike$\u20ac\u00a5\u5143";
   let id = ID.set('foo', new Identity('foo', 'luser'));
   id.password = passphrase;