[Common] JS logs are turned off with debugging flag 56/116656/1
authorPiotr Kosko <p.kosko@samsung.com>
Mon, 27 Feb 2017 11:31:56 +0000 (12:31 +0100)
committerPiotr Kosko <p.kosko@samsung.com>
Mon, 27 Feb 2017 11:32:05 +0000 (12:32 +0100)
[Feature] console.log is disabled by default but can be easily enable
  with setting a flag to 'true' value.

[Verification] Related TCTs result didn't change.

Change-Id: If19acaf3a9e2cd8d33bbeb15118b5c6d72f75ac2
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>
21 files changed:
src/account/account_api.js
src/alarm/alarm_api.js
src/application/application_api.js
src/archive/archive_api.js
src/bluetooth/bluetooth_api.js
src/callhistory/callhistory_api.js
src/contact/js/contact.js
src/content/js/datatypes.js
src/convergence/convergence_api.js
src/download/download_api.js
src/filesystem/js/common.js
src/filesystem/js/file.js
src/humanactivitymonitor/humanactivitymonitor_api.js
src/iotcon/iotcon_api.js
src/messageport/messageport_api.js
src/messaging/messaging_api.js
src/nfc/nfc_api.js
src/secureelement/secureelement_api.js
src/systeminfo/systeminfo_api.js
src/time/time_api.js
src/utils/utils_api.js

index 8ea2311fe97dc6c09e9eee21fe3fac11b1185e6b..3f9a31b90837027d26af9d1bf28b7cdddb1f492c 100755 (executable)
@@ -18,6 +18,7 @@ var validator_ = xwalk.utils.validator;
 var types_ = validator_.Types;
 var T_ = xwalk.utils.type;
 var native_ = new xwalk.utils.NativeManager(extension);
+var privUtils_ = xwalk.utils;
 
 
 function InternalValues_(data) {
@@ -361,7 +362,7 @@ function AccountListeners() {
                     break;
 
                 default:
-                    console.log('Unknown event: ' + event.action);
+                    privUtils_.log('Unknown event: ' + event.action);
                     break;
             }
 
index 5db5edc87b391688838e3f6ca2b4dfb6179d0d2f..78f22adf53d1b9ac00db2ba202e88a3a686eb538 100755 (executable)
@@ -17,6 +17,7 @@
 var T = xwalk.utils.type;
 var Converter = xwalk.utils.converter;
 var AV = xwalk.utils.validator;
+var privUtils_ = xwalk.utils;
 
 var native = new xwalk.utils.NativeManager(extension);
 
@@ -227,7 +228,7 @@ tizen.AlarmRelative.prototype.getRemainingSeconds = function () {
 };
 
 function makeDateConst(obj) {
-    console.log('Enter MakeConst');
+    privUtils_.log('Enter MakeConst');
     obj.setDate = function() {};
     obj.setFullYear = function() {};
     obj.setHours = function() {};
@@ -244,7 +245,7 @@ function makeDateConst(obj) {
     obj.setUTCMonth = function() {};
     obj.setUTCSeconds = function() {};
     obj.setYear = function() {};
-    console.log('Leave MakeConst');
+    privUtils_.log('Leave MakeConst');
 }
 
 //class AlarmAbsolute //////////////////////////////////////////////////
index 77805ef87c68c4d309e7a170d523cee989cf8a39..b0d5774dc71375e73e7e26dc75ddf4c28e7c09ca 100755 (executable)
@@ -17,6 +17,7 @@
 var T = xwalk.utils.type;
 var Converter = xwalk.utils.converter;
 var AV = xwalk.utils.validator;
+var privUtils_ = xwalk.utils;
 
 var native = new xwalk.utils.NativeManager(extension);
 
@@ -517,7 +518,7 @@ ListenerManager.prototype.onListenerCalled = function(msg) {
     break;
 
   default:
-    console.logd('Unknown mode: ' + msg.action);
+    privUtils_.log('Unknown mode: ' + msg.action);
   return;
   }
 
@@ -529,7 +530,7 @@ ListenerManager.prototype.onListenerCalled = function(msg) {
 };
 
 ListenerManager.prototype.addListener = function(callback) {
-  console.log('ListenerManager.prototype.addListener');
+  privUtils_.log('ListenerManager.prototype.addListener');
   var id = this.nextId;
   if (!this.nativeSet) {
     this.native.addListener(this.listenerName, this.onListenerCalled.bind(this));
@@ -683,7 +684,7 @@ Application.prototype.addEventListener = function(event, callback) {
       var parsedName = eventName.split('.');
       var eventInfo = {};
       if (parsedName.length < 3) {
-        console.logd('Invalid event name returned' + eventName);
+        privUtils_.log('Invalid event name returned' + eventName);
       }
       for (var id in event_listeners_[eventName]) {
         if (event_listeners_[eventName].hasOwnProperty(id)) {
index 4de31abde50b8fd250d5d2dd71aeeef942b72eef..f2fca2914846b865ea3e05fa2f5da1f2023130eb 100755 (executable)
@@ -17,6 +17,7 @@
 var validator_ = xwalk.utils.validator;
 var types_ = validator_.Types;
 var native_ = new xwalk.utils.NativeManager(extension);
+var privUtils_ = xwalk.utils;
 
 function CommonFS() {};
 
@@ -37,7 +38,7 @@ function _initializeCache() {
             };
         }
     } catch(e) {
-        console.log("Exception while getting widget paths was thrown: " + e);
+        privUtils_.log("Exception while getting widget paths was thrown: " + e);
     }
 }
 
@@ -62,7 +63,7 @@ CommonFS.toRealPath = function(aPath) {
     } else {
         _fileRealPath = aPath;
     }
-    console.log("REAL PATH:" + _fileRealPath);
+    privUtils_.log("REAL PATH:" + _fileRealPath);
     if (_fileRealPath === "undefined" || _fileRealPath === "null") {
         throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR);
     }
@@ -110,7 +111,7 @@ var Property = {
  * }
  *
  * m.name = 'A brand new name';
- * console.log(m.name); // Name
+ * privUtils_.log(m.name); // Name
  */
 function propertyFactory_(that, name, value, flags, options) {
     flags = flags || 0;
index bebe73e3a22052a6af86b6fbaad31d790ea2fca8..117ff30a41368fb8a72dcfca9898ecfd8aee9906 100755 (executable)
@@ -413,7 +413,7 @@ var BluetoothClass = function(data) {
 };
 
 var BluetoothClass_hasService = function() {
-  console.log('Entered BluetoothClass.hasService()');
+  privUtils_.log('Entered BluetoothClass.hasService()');
   privUtils_.checkPrivilegeAccess4Ver("2.4", Privilege.BLUETOOTH, Privilege.BLUETOOTH_GAP);
 
   var args = AV.validateMethod(arguments, [
@@ -458,7 +458,7 @@ function BluetoothSocketListeners() {
                 callback();
             }
         } else {
-            console.log('Received event for an unknown socket: ' + event.id);
+            privUtils_.log('Received event for an unknown socket: ' + event.id);
         }
     };
 }
@@ -497,7 +497,7 @@ var BluetoothSocket = function(data) {
 };
 
 BluetoothSocket.prototype.writeData = function() {
-    console.log('Entered BluetoothSocket.writeData()');
+    privUtils_.log('Entered BluetoothSocket.writeData()');
 
     var args = AV.validateMethod(arguments, [
         {
@@ -522,7 +522,7 @@ BluetoothSocket.prototype.writeData = function() {
 };
 
 BluetoothSocket.prototype.readData = function() {
-    console.log('Entered BluetoothSocket.readData()');
+    privUtils_.log('Entered BluetoothSocket.readData()');
 
     var callArgs = {
         id : this._id
@@ -538,7 +538,7 @@ BluetoothSocket.prototype.readData = function() {
 };
 
 BluetoothSocket.prototype.close = function() {
-    console.log('Entered BluetoothSocket.close()');
+    privUtils_.log('Entered BluetoothSocket.close()');
 
     if (_BLUETOOTH_SOCKET_STATE_CLOSED !== this.state) {
         var callArgs = {
@@ -613,7 +613,7 @@ var BluetoothLEDevice = function(data) {
 };
 
 BluetoothLEDevice.prototype.connect = function() {
-    console.log('Entered BluetoothLEDevice.connect()');
+    privUtils_.log('Entered BluetoothLEDevice.connect()');
     var args = AV.validateMethod(arguments, [
     {
         name : 'successCallback',
@@ -644,7 +644,7 @@ BluetoothLEDevice.prototype.connect = function() {
 };
 
 BluetoothLEDevice.prototype.disconnect = function() {
-    console.log('Entered BluetoothLEDevice.disconnect()');
+    privUtils_.log('Entered BluetoothLEDevice.disconnect()');
     var args = AV.validateMethod(arguments, [
     {
         name : 'successCallback',
@@ -674,7 +674,7 @@ BluetoothLEDevice.prototype.disconnect = function() {
 };
 
 BluetoothLEDevice.prototype.getService = function() {
-    console.log('Entered BluetoothLEDevice.getService()');
+    privUtils_.log('Entered BluetoothLEDevice.getService()');
     var args = AV.validateMethod(arguments, [
         {
             name: 'uuid',
@@ -696,7 +696,7 @@ BluetoothLEDevice.prototype.getService = function() {
 };
 
 BluetoothLEDevice.prototype.getServiceAllUuids = function() {
-  console.log('Entered BluetoothLEDevice.getServiceAllUuids()');
+  privUtils_.log('Entered BluetoothLEDevice.getServiceAllUuids()');
 
   var callArgs = {
     address : this.address
@@ -712,7 +712,7 @@ BluetoothLEDevice.prototype.getServiceAllUuids = function() {
 };
 
 BluetoothLEDevice.prototype.addConnectStateChangeListener = function() {
-    console.log('Entered BluetoothLEDevice.addConnectStateChangeListener()');
+    privUtils_.log('Entered BluetoothLEDevice.addConnectStateChangeListener()');
     var args = AV.validateMethod(arguments, [
         {
             name: 'listener',
@@ -735,7 +735,7 @@ BluetoothLEDevice.prototype.addConnectStateChangeListener = function() {
 };
 
 BluetoothLEDevice.prototype.removeConnectStateChangeListener = function() {
-    console.log('Entered BluetoothLEDevice.removeConnectStateChangeListener()');
+    privUtils_.log('Entered BluetoothLEDevice.removeConnectStateChangeListener()');
 
     var args = AV.validateMethod(arguments, [
         {
@@ -812,7 +812,7 @@ var BluetoothDevice = function(data) {
 };
 
 BluetoothDevice.prototype.connectToServiceByUUID = function() {
-    console.log('Entered BluetoothDevice.connectToServiceByUUID()');
+    privUtils_.log('Entered BluetoothDevice.connectToServiceByUUID()');
 
     var args = AV.validateMethod(arguments, [
         {
@@ -858,7 +858,7 @@ function BluetoothServiceListeners() {
         var result = new BluetoothSocket(e);
 
         if (service) {
-            console.log(service);
+            privUtils_.log(service);
             service.onconnect(result);
         }
     };
@@ -914,7 +914,7 @@ var BluetoothServiceHandler = function(data) {
 };
 
 BluetoothServiceHandler.prototype.unregister = function() {
-    console.log('Entered BluetoothServiceHandler.unregister()');
+    privUtils_.log('Entered BluetoothServiceHandler.unregister()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'successCallback',
@@ -967,13 +967,13 @@ function BluetoothHealthApplicationListeners() {
                     break;
 
                 default:
-                    console.log('Unknown event: ' + event.event);
+                    privUtils_.log('Unknown event: ' + event.event);
                     break;
                 }
                 callback(param);
             }
         } else {
-            console.log('Received event for an unknown application: ' + event.id);
+            privUtils_.log('Received event for an unknown application: ' + event.id);
         }
     };
 }
@@ -1010,7 +1010,7 @@ var BluetoothHealthApplication = function(data) {
 };
 
 BluetoothHealthApplication.prototype.unregister = function() {
-    console.log('Entered BluetoothHealthApplication.unregister()');
+    privUtils_.log('Entered BluetoothHealthApplication.unregister()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'successCallback',
@@ -1067,7 +1067,7 @@ BluetoothHealthProfileHandler.prototype = new BluetoothProfileHandler();
 BluetoothHealthProfileHandler.prototype.constructor = BluetoothProfileHandler;
 
 BluetoothHealthProfileHandler.prototype.registerSinkApplication = function() {
-    console.log('Entered BluetoothHealthProfileHandler.registerSinkApplication()');
+    privUtils_.log('Entered BluetoothHealthProfileHandler.registerSinkApplication()');
 
     var args = AV.validateMethod(arguments, [
         {
@@ -1110,7 +1110,7 @@ BluetoothHealthProfileHandler.prototype.registerSinkApplication = function() {
 };
 
 BluetoothHealthProfileHandler.prototype.connectToSource = function() {
-    console.log('Entered BluetoothHealthProfileHandler.connectToSource()');
+    privUtils_.log('Entered BluetoothHealthProfileHandler.connectToSource()');
 
     var args = AV.validateMethod(arguments, [
         {
@@ -1177,7 +1177,7 @@ var BluetoothHealthChannel = function(data) {
 };
 
 BluetoothHealthChannel.prototype.close = function() {
-    console.log('Entered BluetoothHealthChannel.close()');
+    privUtils_.log('Entered BluetoothHealthChannel.close()');
 
     if (this.isConnected) {
         var callArgs = {
@@ -1196,7 +1196,7 @@ BluetoothHealthChannel.prototype.close = function() {
 };
 
 BluetoothHealthChannel.prototype.sendData = function() {
-    console.log('Entered BluetoothHealthChannel.sendData()');
+    privUtils_.log('Entered BluetoothHealthChannel.sendData()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'data',
@@ -1235,7 +1235,7 @@ function _BluetoothHealthChannelChangeCallback(event) {
         break;
 
     default:
-        console.log('Unknown mode: ' + e.event);
+        privUtils_.log('Unknown mode: ' + e.event);
         return;
     }
 
@@ -1245,7 +1245,7 @@ function _BluetoothHealthChannelChangeCallback(event) {
 }
 
 var BluetoothHealthChannel_setListener = function() {
-  console.log('Entered BluetoothHealthChannel.setListener()');
+  privUtils_.log('Entered BluetoothHealthChannel.setListener()');
   privUtils_.checkPrivilegeAccess4Ver("2.4", Privilege.BLUETOOTH, Privilege.BLUETOOTH_HEALTH);
   var args = AV.validateMethod(arguments, [
       {
@@ -1268,7 +1268,7 @@ BluetoothHealthChannel.prototype.setListener = function() {
 };
 
 var BluetoothHealthChannel_unsetListener  = function() {
-  console.log('Entered BluetoothHealthChannel.unsetListener ()');
+  privUtils_.log('Entered BluetoothHealthChannel.unsetListener ()');
   if (T.isEmptyObject(_healthListeners)) {
     privUtils_.checkPrivilegeAccess4Ver("2.4", Privilege.BLUETOOTH, Privilege.BLUETOOTH_HEALTH);
   }
@@ -1355,7 +1355,7 @@ var _bleScanListener = _singleListenerBuilder('BluetoothLEScanCallback',
       return ret;
 
     default:
-      console.log('Unknown mode: ' + event.action);
+      privUtils_.log('Unknown mode: ' + event.action);
       return ret;
   }
   if (successCallback) {
@@ -1387,7 +1387,7 @@ var _bleAdvertiseListener = _singleListenerBuilder('BluetoothLEAdvertiseCallback
       return ret;
 
     default:
-      console.log('Unknown mode: ' + event.action);
+      privUtils_.log('Unknown mode: ' + event.action);
       return ret;
   }
 });
@@ -1397,7 +1397,7 @@ var BluetoothLEAdapter = function() {
 };
 
 BluetoothLEAdapter.prototype.startScan = function() {
-  console.log('Entered BluetoothLEAdapter.startScan()');
+  privUtils_.log('Entered BluetoothLEAdapter.startScan()');
   var args = AV.validateMethod(arguments, [{
     name: 'successCallback',
     type: AV.Types.FUNCTION
@@ -1417,7 +1417,7 @@ BluetoothLEAdapter.prototype.startScan = function() {
 };
 
 BluetoothLEAdapter.prototype.stopScan = function() {
-  console.log('Entered BluetoothLEAdapter.stopScan()');
+  privUtils_.log('Entered BluetoothLEAdapter.stopScan()');
 
   _bleScanListener.removeListener();
 
@@ -1439,7 +1439,7 @@ var _BluetoothAdvertisingMode = {
 };
 
 BluetoothLEAdapter.prototype.startAdvertise = function() {
-  console.log('Entered BluetoothLEAdapter.startAdvertise()');
+  privUtils_.log('Entered BluetoothLEAdapter.startAdvertise()');
   var args = AV.validateMethod(arguments, [{
     name: 'advertiseData',
     type: AV.Types.PLATFORM_OBJECT,
@@ -1486,7 +1486,7 @@ BluetoothLEAdapter.prototype.startAdvertise = function() {
 };
 
 BluetoothLEAdapter.prototype.stopAdvertise = function() {
-  console.log('Entered BluetoothLEAdapter.stopAdvertise()');
+  privUtils_.log('Entered BluetoothLEAdapter.stopAdvertise()');
 
   var result = native.callSync('BluetoothLEAdapter_stopAdvertise', {});
 
@@ -1646,7 +1646,7 @@ var BluetoothGATTCharacteristic = function(data, address) {
   });
 
   this.readValue = function() {
-      console.log('Entered BluetoothGATTCharacteristic.readValue()');
+      privUtils_.log('Entered BluetoothGATTCharacteristic.readValue()');
       var args = AV.validateMethod(arguments, [{
         name: 'successCallback',
         type: AV.Types.FUNCTION
@@ -1676,7 +1676,7 @@ var BluetoothGATTCharacteristic = function(data, address) {
     };
 
     this.writeValue = function() {
-      console.log('Entered BluetoothGATTCharacteristic.writeValue()');
+      privUtils_.log('Entered BluetoothGATTCharacteristic.writeValue()');
       var args = AV.validateMethod(arguments, [{
         name: 'value',
         type: AV.Types.ARRAY,
@@ -1711,7 +1711,7 @@ var BluetoothGATTCharacteristic = function(data, address) {
     };
 
     var addValueChangeListener = function() {
-      console.log('Entered BluetoothGATTCharacteristic.addValueChangeListener()');
+      privUtils_.log('Entered BluetoothGATTCharacteristic.addValueChangeListener()');
       privUtils_.checkPrivilegeAccess4Ver("2.4", Privilege.BLUETOOTH, Privilege.BLUETOOTH_ADMIN);
       var args = AV.validateMethod(arguments, [{
         name: 'callback',
@@ -1734,7 +1734,7 @@ var BluetoothGATTCharacteristic = function(data, address) {
     };
 
     this.removeValueChangeListener = function() {
-      console.log('Entered BluetoothGATTCharacteristic.removeValueChangeListener()');
+      privUtils_.log('Entered BluetoothGATTCharacteristic.removeValueChangeListener()');
 
       var args = AV.validateMethod(arguments, [{
         name: 'watchID',
@@ -1860,7 +1860,7 @@ var BluetoothGATTDescriptor = function(data, address) {
   var address_ = address;
 
   this.readValue = function() {
-    console.log('Entered BluetoothGATTDescriptor.readValue()');
+    privUtils_.log('Entered BluetoothGATTDescriptor.readValue()');
     var args = AV.validateMethod(arguments, [{
       name: 'successCallback',
       type: AV.Types.FUNCTION
@@ -1890,7 +1890,7 @@ var BluetoothGATTDescriptor = function(data, address) {
   };
 
   this.writeValue = function() {
-    console.log('Entered BluetoothGATTDescriptor.writeValue()');
+    privUtils_.log('Entered BluetoothGATTDescriptor.writeValue()');
     var args = AV.validateMethod(arguments, [{
       name: 'value',
       type: AV.Types.ARRAY,
@@ -1994,7 +1994,7 @@ var BluetoothAdapter = function() {
 };
 
 BluetoothAdapter.prototype.setName = function() {
-    console.log('Entered BluetoothAdapter.setName()');
+    privUtils_.log('Entered BluetoothAdapter.setName()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'name',
@@ -2033,7 +2033,7 @@ BluetoothAdapter.prototype.setName = function() {
 };
 
 BluetoothAdapter.prototype.setPowered = function() {
-    console.log('Entered BluetoothAdapter.setPowered()');
+    privUtils_.log('Entered BluetoothAdapter.setPowered()');
     console.warn('DEPRECATION WARNING: setPowered() is deprecated and will be removed from next release. '
         + 'Let the user turn on/off Bluetooth through the Settings application instead.');
 
@@ -2077,7 +2077,7 @@ BluetoothAdapter.prototype.setPowered = function() {
 
 // This method is deprecated since Tizen 2.3 and will be removed in Tizen 3.0.
 BluetoothAdapter.prototype.setVisible = function() {
-    console.log('Entered BluetoothAdapter.setVisible()');
+    privUtils_.log('Entered BluetoothAdapter.setVisible()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'visible',
@@ -2132,7 +2132,7 @@ BluetoothAdapter.prototype.setVisible = function() {
 var _listener;
 
 function _BluetoothAdapterChangeCallback(event) {
-    console.log('_BluetoothAdapterChangeCallback');
+    privUtils_.log('_BluetoothAdapterChangeCallback');
 
     var e = event;
     var d;
@@ -2151,7 +2151,7 @@ function _BluetoothAdapterChangeCallback(event) {
         break;
 
     default:
-        console.log('Unknown mode: ' + e.action);
+        privUtils_.log('Unknown mode: ' + e.action);
         return;
     }
 
@@ -2161,7 +2161,7 @@ function _BluetoothAdapterChangeCallback(event) {
 }
 
 BluetoothAdapter.prototype.setChangeListener = function() {
-    console.log('Entered BluetoothAdapter.setChangeListener()');
+    privUtils_.log('Entered BluetoothAdapter.setChangeListener()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'changeCallback',
@@ -2177,7 +2177,7 @@ BluetoothAdapter.prototype.setChangeListener = function() {
 };
 
 BluetoothAdapter.prototype.unsetChangeListener = function() {
-    console.log('Entered BluetoothAdapter.unsetChangeListener()');
+    privUtils_.log('Entered BluetoothAdapter.unsetChangeListener()');
     if (!T.isNullOrUndefined(_listener)) {
         native.removeListener('BluetoothAdapterChangeCallback', _BluetoothAdapterChangeCallback);
         _listener = undefined;
@@ -2218,7 +2218,7 @@ function _BluetoothDiscoverDevicesSuccessCallback(event) {
         break;
 
     default:
-        console.log('Unknown mode: ' + e.action);
+        privUtils_.log('Unknown mode: ' + e.action);
         return;
     }
 
@@ -2235,7 +2235,7 @@ function _BluetoothDiscoverDevicesErrorCallback(event) {
 }
 
 BluetoothAdapter.prototype.discoverDevices = function() {
-    console.log('Entered BluetoothAdapter.discoverDevices()');
+    privUtils_.log('Entered BluetoothAdapter.discoverDevices()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'successCallback',
@@ -2269,7 +2269,7 @@ BluetoothAdapter.prototype.discoverDevices = function() {
 };
 
 BluetoothAdapter.prototype.stopDiscovery = function() {
-    console.log('Entered BluetoothAdapter.stopDiscovery()');
+    privUtils_.log('Entered BluetoothAdapter.stopDiscovery()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'successCallback',
@@ -2300,7 +2300,7 @@ BluetoothAdapter.prototype.stopDiscovery = function() {
 };
 
 BluetoothAdapter.prototype.getKnownDevices = function() {
-    console.log('Entered BluetoothAdapter.getKnownDevices()');
+    privUtils_.log('Entered BluetoothAdapter.getKnownDevices()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'successCallback',
@@ -2334,7 +2334,7 @@ BluetoothAdapter.prototype.getKnownDevices = function() {
 };
 
 BluetoothAdapter.prototype.getDevice = function() {
-    console.log('Entered BluetoothAdapter.getDevice()');
+    privUtils_.log('Entered BluetoothAdapter.getDevice()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'address',
@@ -2367,7 +2367,7 @@ BluetoothAdapter.prototype.getDevice = function() {
 };
 
 BluetoothAdapter.prototype.createBonding = function() {
-    console.log('Entered BluetoothAdapter.createBonding()');
+    privUtils_.log('Entered BluetoothAdapter.createBonding()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'address',
@@ -2406,7 +2406,7 @@ BluetoothAdapter.prototype.createBonding = function() {
 };
 
 BluetoothAdapter.prototype.destroyBonding = function() {
-    console.log('Entered BluetoothAdapter.destroyBonding()');
+    privUtils_.log('Entered BluetoothAdapter.destroyBonding()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'address',
@@ -2445,7 +2445,7 @@ BluetoothAdapter.prototype.destroyBonding = function() {
 };
 
 BluetoothAdapter.prototype.registerRFCOMMServiceByUUID = function() {
-    console.log('Entered BluetoothAdapter.registerRFCOMMServiceByUUID()');
+    privUtils_.log('Entered BluetoothAdapter.registerRFCOMMServiceByUUID()');
     var args = AV.validateMethod(arguments, [
         {
             name : 'uuid',
@@ -2489,7 +2489,7 @@ BluetoothAdapter.prototype.registerRFCOMMServiceByUUID = function() {
 };
 
 BluetoothAdapter.prototype.getBluetoothProfileHandler = function() {
-    console.log('Entered BluetoothAdapter.getBluetoothProfileHandler()');
+    privUtils_.log('Entered BluetoothAdapter.getBluetoothProfileHandler()');
 
     var args = AV.validateMethod(arguments, [
         {
@@ -2545,7 +2545,7 @@ var BluetoothManager_getDefaultAdapter = function() {
 
 
 BluetoothManager.prototype.getDefaultAdapter = function() {
-    console.log('Entered BluetoothManager.getDefaultAdapter()');
+    privUtils_.log('Entered BluetoothManager.getDefaultAdapter()');
     return BluetoothManager_getDefaultAdapter();
 };
 
@@ -2556,7 +2556,7 @@ var BluetoothManager_getLEAdapter = function() {
 };
 
 BluetoothManager.prototype.getLEAdapter = function() {
-    console.log('Entered BluetoothManager.getLEAdapter()');
+    privUtils_.log('Entered BluetoothManager.getLEAdapter()');
     return BluetoothManager_getLEAdapter();
 };
 // exports ///////////////////////////////////////////////////////////////////
index 79e8c8bd257c6b4ca071f462b556c87a20b00e61..e2ed279c9caf3492f5115a65ec9b58ffb3b452c5 100755 (executable)
@@ -64,7 +64,7 @@ ListenerManager.prototype.onListenerCalled = function(msg) {
         break;
 
     default:
-        console.log('Unknown mode: ' + msg.action);
+        privUtils_.log('Unknown mode: ' + msg.action);
         return;
     }
 
index bb2f1685524c0f97298159e24b5f70a1463494d8..af317dee75780795a96bc92cc544dcdcaa9bc6fb 100755 (executable)
@@ -362,14 +362,14 @@ var _contactAddressToString = function(obj) {
 // Convert email address from Contact object to string
 var _contactEmailToString = function(obj) {
   if (!type_.isArray(obj.emails) || obj.emails.length === 0) {
-    console.log('Empty email list');
+    utils_.log('Empty email list');
     return '';
   }
   var str = '';
   for (var mail in obj.emails) {
     if (!mail instanceof ContactEmailAddress || !type_.isArray(mail.types) ||
       mail.types.length === 0) {
-      console.log('Incorrect email type');
+      utils_.log('Incorrect email type');
       continue;
     }
     str += 'EMAIL;';
index 0768f9f2b351cb9dfe235e4c6228facd6efacb4e..adb826d9f0129ae4a0373879dc27c1e79a18f391 100755 (executable)
@@ -478,7 +478,7 @@ function AudioContent(data) {
     var result = native_.callSync('ContentManager_getLyrics', data);
 
     if (native_.isFailure(result)) {
-      console.log('Getting lyrics failed for ' + data.contentURI);
+      utils_.log('Getting lyrics failed for ' + data.contentURI);
       return;
     }
 
index 49d6b210349d861d46a6638dce4def87de91901c..6b025068d185331bd303533a1de9f87abb4c26c5 100644 (file)
@@ -204,7 +204,7 @@ ConvergenceManager.prototype.startDiscovery = function(successCallback,
         convergenceDevices = [];
 
       } else {
-        console.log('UNKNOWN discovery state exception');
+        utils_.log('UNKNOWN discovery state exception');
       }
     }
   });
index 018bfca27c6e24f232502888dce461f51bb2571f..b47ddd070db1112862e2fb0795c6ed8bbb498a05 100755 (executable)
@@ -13,7 +13,8 @@
  *    See the License for the specific language governing permissions and
  *    limitations under the License.
  */
+
+var privUtils_ = xwalk.utils;
 var validator_ = xwalk.utils.validator;
 var types_ = validator_.Types;
 var check_ = xwalk.utils.type;
@@ -28,10 +29,10 @@ extension.setMessageListener(function(json) {
 
   var result = JSON.parse(json);
   var callback = callbacks[result.callbackId];
-  //console.log("PostMessage received: " + result.status);
+  //privUtils_.log("PostMessage received: " + result.status);
 
   if (!callback) {
-    console.logd('Ignoring unknown callback: ' + result.callbackId);
+    privUtils_.log('Ignoring unknown callback: ' + result.callbackId);
     return;
   }
   setTimeout(function() {
index 15cc697305cb28a8e27a69d7a82ecd41090b53af..6eeddca6b80668488e44e20cbe0aeddf6824701f 100644 (file)
@@ -130,7 +130,7 @@ var commonFS_ = (function() {
         });
         listenerRegistered = true;
       } catch (e) {
-        console.log('Failed to register storage change listener, '
+        privUtils_.log('Failed to register storage change listener, '
             + 'storage information may be corrupted: ' + e.message);
       }
     }
@@ -189,7 +189,7 @@ var commonFS_ = (function() {
   function convertForEarlierVersionPath(aPath) {
     if (isAppForEarlierVersion) {
       if (aPath && aPath.indexOf(tizen24home) === 0) {
-        console.log("Converting 2.4 style path to 3.0 pattern");
+        privUtils_.log("Converting 2.4 style path to 3.0 pattern");
         aPath = homeDir + aPath.substr(tizen24home.length);
       }
     }
index 4b07da67402149dea077c0ceed4ca628bfb2a6e9..7622d532ef2ef0f175d319e254f369024d740825 100644 (file)
@@ -37,7 +37,7 @@ function File(data) {
             return null;
           }
         } catch (err) {
-          console.log(err.name, err.message);
+          privUtils_.log(err.name, err.message);
           return null;
         }
       }(data)),
index 736b9a49af70a5e9dd0438836a8fec1884501c07..81002ebf2cb5d44469e847294ba48cf2307bc9ab 100755 (executable)
@@ -320,7 +320,7 @@ HumanActivityMonitorManager.prototype.start = function(type, changedCallback) {
       };
   }
 
-  console.log("callbackInterval = " + callbackInterval + ", sampleInterval = " + sampleInterval);
+  utils_.log("callbackInterval = " + callbackInterval + ", sampleInterval = " + sampleInterval);
   startListener(listenerId,
                 listener,
                 'HumanActivityMonitorManager_start',
index e33a562cea238f87ff5fbece5ddad96fdad39225..9290d32246374f0f6bf285c2179500feccc6b813 100644 (file)
@@ -20,6 +20,7 @@ var types = validator.Types;
 var T = xwalk.utils.type;
 var kIdKey = Symbol();
 var converter =  xwalk.utils.converter;
+var privUtils_ = xwalk.utils;
 
 function createListener(name, c) {
   var listenerName = name;
@@ -601,7 +602,7 @@ function prepareResourceInfo(that, notIncludeOptions){
   var callArgs = {};
   callArgs.id = that[kIdKey];
   if (!callArgs.id) {
-    console.log("RemoteResource is not already stored in C++ layer, adding all members");
+    privUtils_.log("RemoteResource is not already stored in C++ layer, adding all members");
     callArgs.hostAddress = that.hostAddress;
     callArgs.connectivityType = that.connectivityType;
     callArgs.uriPath = that.uriPath;
@@ -618,7 +619,7 @@ function prepareResourceInfo(that, notIncludeOptions){
       callArgs.options = that.options;
     }
   } else {
-    console.log("Already stored in C++, all needed info is id");
+    privUtils_.log("Already stored in C++, all needed info is id");
   }
   return callArgs;
 }
@@ -626,9 +627,9 @@ function prepareResourceInfo(that, notIncludeOptions){
 function manageId(that, result) {
   if (result.keepId) {
     that[kIdKey] = result.id;
-    console.log("Keep id of resource: " + that[kIdKey]);
+    privUtils_.log("Keep id of resource: " + that[kIdKey]);
   } else {
-    console.log("Clear id of resource");
+    privUtils_.log("Clear id of resource");
     delete that[kIdKey];
   }
   delete result.keepId;
index acc1caea4b873c4b6601503097446de3f37270a3..cada46b70cf739c27f22e5dbf2c067288cd867f7 100755 (executable)
@@ -18,6 +18,7 @@ var validator_ = xwalk.utils.validator;
 var types_ = validator_.Types;
 var type_ = xwalk.utils.type;
 var converter_ = xwalk.utils.converter;
+var privUtils_ = xwalk.utils;
 
 var callbackId = 0;
 var callbacks = {};
@@ -28,7 +29,7 @@ extension.setMessageListener(function(json) {
   var listeners = callbacks[msg['local_port_id']];
   var rmp;
 
-  console.log('Listeners length:' + listeners.length);
+  privUtils_.log('Listeners length:' + listeners.length);
 
   if (!msg.hasOwnProperty('remotePort'))
     rmp = null;
index dbae2b48f2f5da11960d61591b7ebea249169eb5..fe4f4f7e13afc034b42b4b974d8b14038fe9f24d 100755 (executable)
@@ -18,6 +18,7 @@ var validator_ = xwalk.utils.validator;
 var types_ = validator_.Types;
 var T_ = xwalk.utils.type;
 var native = new xwalk.utils.NativeManager(extension);
+var privUtils_ = xwalk.utils;
 
 function throwException_(err) {
     throw new WebAPIException(err.code, err.name, err.message);
@@ -75,7 +76,7 @@ function addTypeToFilter_(data)
  * }
  *
  * m.name = 'A brand new name';
- * console.log(m.name); // Name
+ * privUtils_.log(m.name); // Name
  */
 function propertyFactory_(that, name, value, flags, options) {
     flags = flags || 0;
index c97646f2811c9d759038abcc1f0e9a5e41f81ec8..db3d0e3122011df2555297c84540cce2f21db39d 100644 (file)
@@ -992,7 +992,7 @@ function NFCTag(tagid) {
       return;
     }
 
-    console.log('Current result: ' + result);
+    privUtils_.log('Current result: ' + result);
 
     var result_array = {};
     for (var i in result.result) {
index e175529ef49fefb70abd7a97f1dbb4b6e23e34d5..db67d0215317f6532cd676a7dd502d6869c65bcb 100644 (file)
@@ -42,7 +42,7 @@ ListenerManager.prototype.onListenerCalled = function(msg) {
         d = new Reader(msg.handle);
         break;
     default:
-        console.log('Unknown mode: ' + msg.action);
+        privUtils_.log('Unknown mode: ' + msg.action);
         return;
     }
 
@@ -184,7 +184,7 @@ function Reader(reader_handle) {
                             var callArgs = { handle: reader_handle };
                             var result = native_.callSync('SEReader_isPresent', callArgs);
                             if (native_.isFailure(result)) {
-                              console.log('SEReader_isPresent error: ' + native_.getErrorObject(result));
+                              privUtils_.log('SEReader_isPresent error: ' + native_.getErrorObject(result));
                               return false;
                             } else {
                               return native_.getResultObject(result);
@@ -306,7 +306,7 @@ function Session(session_handle) {
                         var callArgs = { handle: session_handle };
                         var result = native_.callSync('SESession_isClosed', callArgs);
                         if (native_.isFailure(result)) {
-                          console.log('SESession_isClosed error: ' + native_.getErrorObject(result));
+                          privUtils_.log('SESession_isClosed error: ' + native_.getErrorObject(result));
                           return true;
                         } else {
                           return native_.getResultObject(result);
index d6b9634dbfa2db5c65c24e072004598741a1c763..ce4755b58aafbb61363e0749e756e110c56e6fef 100644 (file)
@@ -1221,7 +1221,7 @@ var _listenerFunction = function(msg) {
     if (propertyId) {
         _propertyContainer[propertyId].broadcastFunction(msg);
     } else {
-        console.log("No propertyId provided - ignoring");
+        privUtils_.log("No propertyId provided - ignoring");
     }
 }
 native_.addListener("SysteminfoCommonListenerLabel", _listenerFunction);
@@ -1275,7 +1275,7 @@ var _unregisterListener = function (watchId, isTimeout) {
     } catch (e) {
         // if it is "auto" timeout call it should not throw an exception
         if (isTimeout) {
-            console.log('Listener was already deleted');
+            privUtils_.log('Listener was already deleted');
             return;
         }
         throw e;
index 67ae67427d91a01bc730dd6704ab5ca7f2c1d4b3..95c9d6f7cee4b75aff73ac0c531042a3a9241ed3 100644 (file)
@@ -77,7 +77,7 @@ function _constructTZDate(obj, privateTZDate) {
 
   switch (tzName) {
   case _LOCAL_ID:
-    console.log('Entered _constructTZDate for local timezone');
+    utils_.log('Entered _constructTZDate for local timezone');
 
     tzName = tizen.time.getLocalTimezone();
 
@@ -87,7 +87,7 @@ function _constructTZDate(obj, privateTZDate) {
     break;
 
   case _GMT_ID:
-    console.log('Entered _constructTZDate for GMT');
+    utils_.log('Entered _constructTZDate for GMT');
 
     if (T.isNullOrUndefined(offset)) {
       offset = 0;
@@ -95,7 +95,7 @@ function _constructTZDate(obj, privateTZDate) {
     break;
 
   default:
-    console.log('Entered _constructTZDate for: ' + tzName);
+    utils_.log('Entered _constructTZDate for: ' + tzName);
     if (T.isNullOrUndefined(offset)) {
       // throws if tzName is invalid
       offset = _getTimezoneOffset(utcTimestamp, tzName).offset;
@@ -113,7 +113,7 @@ function _constructTZDate(obj, privateTZDate) {
 
 //class TZDate ////////////////////////////////////////////////////
 tizen.TZDate = function(p1, p2, day, hours, minutes, seconds, milliseconds, timezone) {
-  console.log("Entered tizen.TZDate");
+  utils_.log("Entered tizen.TZDate");
   validator_.validateConstructorCall(this, tizen.TZDate);
 
   var priv;
@@ -122,7 +122,7 @@ tizen.TZDate = function(p1, p2, day, hours, minutes, seconds, milliseconds, time
     priv = p1;
   } else {
     //Public constructor section
-    console.log('Entered TZDate constructor with: ' + arguments.length + ' attributes');
+    utils_.log('Entered TZDate constructor with: ' + arguments.length + ' attributes');
 
     var date;
 
@@ -187,7 +187,7 @@ tizen.TZDate = function(p1, p2, day, hours, minutes, seconds, milliseconds, time
 };
 
 tizen.TZDate.prototype.getDate = function() {
-  console.log('Entered TZDate.getDate');
+  utils_.log('Entered TZDate.getDate');
   //getters realized with pattern
   //---> use _shiftedTimestamp (_utcTimestamp (UTC) with added _timezoneOffset)
   //---> create Date instance
@@ -227,157 +227,157 @@ function _updateTZDateUTC(tzdate, args, param, func) {
 }
 
 tizen.TZDate.prototype.setDate = function() {
-  console.log('Entered TZDate.setDate');
+  utils_.log('Entered TZDate.setDate');
   _updateTZDate(this, arguments, 'date', 'setUTCDate');
 };
 
 tizen.TZDate.prototype.getDay = function() {
-  console.log('Entered TZDate.getDay');
+  utils_.log('Entered TZDate.getDay');
   return _createShiftedDate(this).getUTCDay();
 };
 
 tizen.TZDate.prototype.getFullYear = function() {
-  console.log('Entered TZDate.getFullYear');
+  utils_.log('Entered TZDate.getFullYear');
   return _createShiftedDate(this).getUTCFullYear();
 };
 
 tizen.TZDate.prototype.setFullYear = function() {
-  console.log('Entered TZDate.setFullYear');
+  utils_.log('Entered TZDate.setFullYear');
   _updateTZDate(this, arguments, 'year', 'setUTCFullYear');
 };
 
 tizen.TZDate.prototype.getHours = function() {
-  console.log('Entered TZDate.getHours');
+  utils_.log('Entered TZDate.getHours');
   return _createShiftedDate(this).getUTCHours();
 };
 
 tizen.TZDate.prototype.setHours = function() {
-  console.log('Entered TZDate.setHours');
+  utils_.log('Entered TZDate.setHours');
   _updateTZDate(this, arguments, 'hours', 'setUTCHours');
 };
 
 tizen.TZDate.prototype.getMilliseconds = function() {
-  console.log('Entered TZDate.getMilliseconds');
+  utils_.log('Entered TZDate.getMilliseconds');
   return _createShiftedDate(this).getUTCMilliseconds();
 };
 
 tizen.TZDate.prototype.setMilliseconds = function() {
-  console.log('Entered TZDate.setMilliseconds');
+  utils_.log('Entered TZDate.setMilliseconds');
   _updateTZDate(this, arguments, 'ms', 'setUTCMilliseconds');
 };
 
 tizen.TZDate.prototype.getMinutes = function() {
-  console.log('Entered TZDate.getMinutes');
+  utils_.log('Entered TZDate.getMinutes');
   return _createShiftedDate(this).getUTCMinutes();
 };
 
 tizen.TZDate.prototype.setMinutes = function() {
-  console.log('Entered TZDate.setMinutes');
+  utils_.log('Entered TZDate.setMinutes');
   _updateTZDate(this, arguments, 'minutes', 'setUTCMinutes');
 };
 
 tizen.TZDate.prototype.getMonth = function() {
-  console.log('Entered TZDate.getMonth');
+  utils_.log('Entered TZDate.getMonth');
   return _createShiftedDate(this).getUTCMonth();
 };
 
 tizen.TZDate.prototype.setMonth = function() {
-  console.log('Entered TZDate.setMonth');
+  utils_.log('Entered TZDate.setMonth');
   _updateTZDate(this, arguments, 'month', 'setUTCMonth');
 };
 
 tizen.TZDate.prototype.getSeconds = function() {
-  console.log('Entered TZDate.getSeconds');
+  utils_.log('Entered TZDate.getSeconds');
   return _createShiftedDate(this).getUTCSeconds();
 };
 
 tizen.TZDate.prototype.setSeconds = function() {
-  console.log('Entered TZDate.setSeconds');
+  utils_.log('Entered TZDate.setSeconds');
   _updateTZDate(this, arguments, 'seconds', 'setUTCSeconds');
 };
 
 tizen.TZDate.prototype.getUTCDate = function() {
-  console.log('Entered TZDate.getUTCDate');
+  utils_.log('Entered TZDate.getUTCDate');
   return _createUTCDate(this).getUTCDate();
 };
 
 tizen.TZDate.prototype.setUTCDate = function() {
-  console.log('Entered TZDate.setUTCDate');
+  utils_.log('Entered TZDate.setUTCDate');
   _updateTZDateUTC(this, arguments, 'date', 'setUTCDate');
 };
 
 tizen.TZDate.prototype.getUTCDay = function() {
-  console.log('Entered TZDate.getUTCDay');
+  utils_.log('Entered TZDate.getUTCDay');
   return _createUTCDate(this).getUTCDay();
 };
 
 tizen.TZDate.prototype.getUTCFullYear = function() {
-  console.log('Entered TZDate.getUTCFullYear');
+  utils_.log('Entered TZDate.getUTCFullYear');
   return _createUTCDate(this).getUTCFullYear();
 };
 
 tizen.TZDate.prototype.setUTCFullYear = function() {
-  console.log('Entered TZDate.setUTCFullYear');
+  utils_.log('Entered TZDate.setUTCFullYear');
   _updateTZDateUTC(this, arguments, 'year', 'setUTCFullYear');
 };
 
 tizen.TZDate.prototype.getUTCHours = function() {
-  console.log('Entered TZDate.getUTCHours');
+  utils_.log('Entered TZDate.getUTCHours');
   return _createUTCDate(this).getUTCHours();
 };
 
 tizen.TZDate.prototype.setUTCHours = function() {
-  console.log('Entered TZDate.setUTCHours');
+  utils_.log('Entered TZDate.setUTCHours');
   _updateTZDateUTC(this, arguments, 'hours', 'setUTCHours');
 };
 
 tizen.TZDate.prototype.getUTCMilliseconds = function() {
-  console.log('Entered TZDate.getUTCMilliseconds');
+  utils_.log('Entered TZDate.getUTCMilliseconds');
   return _createUTCDate(this).getUTCMilliseconds();
 };
 
 tizen.TZDate.prototype.setUTCMilliseconds = function() {
-  console.log('Entered TZDate.setUTCMilliseconds');
+  utils_.log('Entered TZDate.setUTCMilliseconds');
   _updateTZDateUTC(this, arguments, 'ms', 'setUTCMilliseconds');
 };
 
 tizen.TZDate.prototype.getUTCMinutes = function() {
-  console.log('Entered TZDate.getUTCMinutes');
+  utils_.log('Entered TZDate.getUTCMinutes');
   return _createUTCDate(this).getUTCMinutes();
 };
 
 tizen.TZDate.prototype.setUTCMinutes = function() {
-  console.log('Entered TZDate.setUTCMinutes');
+  utils_.log('Entered TZDate.setUTCMinutes');
   _updateTZDateUTC(this, arguments, 'minutes', 'setUTCMinutes');
 };
 
 tizen.TZDate.prototype.getUTCMonth = function() {
-  console.log('Entered TZDate.getUTCMonth');
+  utils_.log('Entered TZDate.getUTCMonth');
   return _createUTCDate(this).getUTCMonth();
 };
 
 tizen.TZDate.prototype.setUTCMonth = function() {
-  console.log('Entered TZDate.setUTCMonth');
+  utils_.log('Entered TZDate.setUTCMonth');
   _updateTZDateUTC(this, arguments, 'month', 'setUTCMonth');
 };
 
 tizen.TZDate.prototype.getUTCSeconds = function() {
-  console.log('Entered TZDate.getUTCSeconds');
+  utils_.log('Entered TZDate.getUTCSeconds');
   return _createUTCDate(this).getUTCSeconds();
 };
 
 tizen.TZDate.prototype.setUTCSeconds = function() {
-  console.log('Entered TZDate.setUTCSeconds');
+  utils_.log('Entered TZDate.setUTCSeconds');
   _updateTZDateUTC(this, arguments, 'seconds', 'setUTCSeconds');
 };
 
 tizen.TZDate.prototype.getTimezone = function() {
-  console.log('Entered TZDate.getTimezone');
+  utils_.log('Entered TZDate.getTimezone');
   return this._timezoneName;
 };
 
 tizen.TZDate.prototype.toTimezone = function() {
-  console.log('Entered TZDate.toTimezone');
+  utils_.log('Entered TZDate.toTimezone');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'timezone',
@@ -388,17 +388,17 @@ tizen.TZDate.prototype.toTimezone = function() {
 };
 
 tizen.TZDate.prototype.toLocalTimezone = function() {
-  console.log('Entered TZDate.toLocalTimezone');
+  utils_.log('Entered TZDate.toLocalTimezone');
   return new tizen.TZDate(new PrivateTZDate(this._utcTimestamp, _LOCAL_ID));
 };
 
 tizen.TZDate.prototype.toUTC = function() {
-  console.log('Entered TZDate.toUTC');
+  utils_.log('Entered TZDate.toUTC');
   return new tizen.TZDate(new PrivateTZDate(this._utcTimestamp, _GMT_ID));
 };
 
 tizen.TZDate.prototype.difference = function() {
-  console.log('Entered TZDate.difference');
+  utils_.log('Entered TZDate.difference');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'other',
@@ -416,7 +416,7 @@ tizen.TZDate.prototype.difference = function() {
 };
 
 tizen.TZDate.prototype.equalsTo = function() {
-  console.log('Entered TZDate.equalsTo');
+  utils_.log('Entered TZDate.equalsTo');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'other',
@@ -428,7 +428,7 @@ tizen.TZDate.prototype.equalsTo = function() {
 };
 
 tizen.TZDate.prototype.earlierThan = function() {
-  console.log('Entered TZDate.earlierThan');
+  utils_.log('Entered TZDate.earlierThan');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'other',
@@ -440,7 +440,7 @@ tizen.TZDate.prototype.earlierThan = function() {
 };
 
 tizen.TZDate.prototype.laterThan = function() {
-  console.log('Entered TZDate.laterThan');
+  utils_.log('Entered TZDate.laterThan');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'other',
@@ -452,7 +452,7 @@ tizen.TZDate.prototype.laterThan = function() {
 };
 
 tizen.TZDate.prototype.addDuration = function() {
-  console.log('Entered TZDate.addDuration');
+  utils_.log('Entered TZDate.addDuration');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'duration',
@@ -466,7 +466,7 @@ tizen.TZDate.prototype.addDuration = function() {
 };
 
 tizen.TZDate.prototype.toLocaleDateString = function() {
-  console.log('Entered TZDate.toLocaleDateString');
+  utils_.log('Entered TZDate.toLocaleDateString');
   var result = native_.callSync('TZDate_toLocaleDateString',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -477,7 +477,7 @@ tizen.TZDate.prototype.toLocaleDateString = function() {
 };
 
 tizen.TZDate.prototype.toLocaleTimeString = function() {
-  console.log('Entered TZDate.toLocaleTimeString');
+  utils_.log('Entered TZDate.toLocaleTimeString');
   var result = native_.callSync('TZDate_toLocaleTimeString',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -488,7 +488,7 @@ tizen.TZDate.prototype.toLocaleTimeString = function() {
 };
 
 tizen.TZDate.prototype.toLocaleString = function() {
-  console.log('Entered TZDate.toLocaleString');
+  utils_.log('Entered TZDate.toLocaleString');
   var result = native_.callSync('TZDate_toLocaleString',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -499,7 +499,7 @@ tizen.TZDate.prototype.toLocaleString = function() {
 };
 
 tizen.TZDate.prototype.toDateString = function() {
-  console.log('Entered TZDate.toDateString');
+  utils_.log('Entered TZDate.toDateString');
   var result = native_.callSync('TZDate_toDateString',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -510,7 +510,7 @@ tizen.TZDate.prototype.toDateString = function() {
 };
 
 tizen.TZDate.prototype.toTimeString = function() {
-  console.log('Entered TZDate.toTimeString');
+  utils_.log('Entered TZDate.toTimeString');
   var result = native_.callSync('TZDate_toTimeString',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -521,7 +521,7 @@ tizen.TZDate.prototype.toTimeString = function() {
 };
 
 tizen.TZDate.prototype.toString = function() {
-  console.log('Entered TZDate.toString');
+  utils_.log('Entered TZDate.toString');
   var result = native_.callSync('TZDate_toString',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -532,7 +532,7 @@ tizen.TZDate.prototype.toString = function() {
 };
 
 tizen.TZDate.prototype.getTimezoneAbbreviation = function() {
-  console.log('Entered TZDate.getTimezoneAbbreviation');
+  utils_.log('Entered TZDate.getTimezoneAbbreviation');
   console.warn('DEPRECATION WARNING: getTimezoneAbbreviation() is deprecated and will be removed from next release.');
 
   var result = native_.callSync('TZDate_getTimezoneAbbreviation',
@@ -545,12 +545,12 @@ tizen.TZDate.prototype.getTimezoneAbbreviation = function() {
 };
 
 tizen.TZDate.prototype.secondsFromUTC = function() {
-  console.log('Entered TZDate.secondsFromUTC');
+  utils_.log('Entered TZDate.secondsFromUTC');
   return -this._timezoneOffset/1000;
 };
 
 tizen.TZDate.prototype.isDST = function() {
-  console.log('Entered TZDate.isDST');
+  utils_.log('Entered TZDate.isDST');
   var result = native_.callSync('TZDate_isDST',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -561,7 +561,7 @@ tizen.TZDate.prototype.isDST = function() {
 };
 
 tizen.TZDate.prototype.getPreviousDSTTransition = function() {
-  console.log('Entered TZDate.getPreviousDSTTransition');
+  utils_.log('Entered TZDate.getPreviousDSTTransition');
   var result = native_.callSync('TZDate_getPreviousDSTTransition',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -574,7 +574,7 @@ tizen.TZDate.prototype.getPreviousDSTTransition = function() {
 };
 
 tizen.TZDate.prototype.getNextDSTTransition = function() {
-  console.log('Entered TZDate.getNextDSTTransition');
+  utils_.log('Entered TZDate.getNextDSTTransition');
   var result = native_.callSync('TZDate_getNextDSTTransition',
       {timezone: String(this._timezoneName),
     timestamp: String(this._utcTimestamp)});
@@ -643,7 +643,7 @@ function _convertMsecsToBiggestPossibleUnit(len) {
 
 //class tizen.TimeDuration ////////////////////////////////////////////////////
 tizen.TimeDuration = function(length, unit) {
-  console.log('Entered TimeDuration constructor');
+  utils_.log('Entered TimeDuration constructor');
   validator_.validateConstructorCall(this, tizen.TimeDuration);
   var l, u;
   if (arguments.length >= 2) {
@@ -690,7 +690,7 @@ tizen.TimeDuration = function(length, unit) {
 }
 
 tizen.TimeDuration.prototype.difference = function() {
-  console.log('Entered TimeDuration.difference');
+  utils_.log('Entered TimeDuration.difference');
 
   var args = validator_.validateMethod(arguments, [
                                                    {
@@ -710,7 +710,7 @@ tizen.TimeDuration.prototype.difference = function() {
 };
 
 tizen.TimeDuration.prototype.equalsTo = function() {
-  console.log('Entered TimeDuration.equalsTo');
+  utils_.log('Entered TimeDuration.equalsTo');
 
   var args = validator_.validateMethod(arguments, [
                                                    {
@@ -730,7 +730,7 @@ tizen.TimeDuration.prototype.equalsTo = function() {
 };
 
 tizen.TimeDuration.prototype.lessThan = function() {
-  console.log('Entered TimeDuration.lessThan');
+  utils_.log('Entered TimeDuration.lessThan');
 
   var args = validator_.validateMethod(arguments, [
                                                    {
@@ -750,7 +750,7 @@ tizen.TimeDuration.prototype.lessThan = function() {
 };
 
 tizen.TimeDuration.prototype.greaterThan = function() {
-  console.log('Entered TimeDuration.greaterThan');
+  utils_.log('Entered TimeDuration.greaterThan');
 
   var args = validator_.validateMethod(arguments, [
                                                    {
@@ -772,12 +772,12 @@ tizen.TimeDuration.prototype.greaterThan = function() {
 
 //class TimeUtil ////////////////////////////////////////////////////
 exports.getCurrentDateTime = function() {
-  console.log('Entered TimeUtil.getCurrentDateTime');
+  utils_.log('Entered TimeUtil.getCurrentDateTime');
   return new tizen.TZDate();
 };
 
 exports.getLocalTimezone = function() {
-  console.log('Entered TimeUtil.getLocalTimezone');
+  utils_.log('Entered TimeUtil.getLocalTimezone');
   var result = native_.callSync('TZDate_getLocalTimezone', {});
   if (native_.isFailure(result)) {
     throw native_.getErrorObject(result);
@@ -788,7 +788,7 @@ exports.getLocalTimezone = function() {
 var _availableTimezones = [];       //an array for holding available timezones
 
 exports.getAvailableTimezones = function() {
-  console.log('Entered TimeUtil.getAvailableTimezones');
+  utils_.log('Entered TimeUtil.getAvailableTimezones');
   if (_availableTimezones.length === 0) {
     var result = native_.callSync('TimeUtil_getAvailableTimezones', {});
     if (native_.isFailure(result)) {
@@ -801,7 +801,7 @@ exports.getAvailableTimezones = function() {
 };
 
 exports.getDateFormat = function() {
-  console.log('Entered TimeUtil.getDateFormat');
+  utils_.log('Entered TimeUtil.getDateFormat');
 
   var args = validator_.validateMethod(arguments, [
                                                    {
@@ -824,7 +824,7 @@ exports.getDateFormat = function() {
 };
 
 exports.getTimeFormat = function() {
-  console.log('Entered TimeUtil.getTimeFormat');
+  utils_.log('Entered TimeUtil.getTimeFormat');
   var result = native_.callSync('TimeUtil_getTimeFormat', {});
   if (native_.isFailure(result)) {
     throw native_.getErrorObject(result);
@@ -833,7 +833,7 @@ exports.getTimeFormat = function() {
 };
 
 exports.isLeapYear = function() {
-  console.log('Entered TimeUtil.isLeapYear');
+  utils_.log('Entered TimeUtil.isLeapYear');
 
   var args = validator_.validateMethod(arguments, [
                                                    {
@@ -849,12 +849,12 @@ exports.isLeapYear = function() {
 
 var _timeUtilDateTimeChangeListener;
 function _timeChangedListenerCallback(eventObj) {
-  console.log("_timeChangedListenerCallback");
+  utils_.log("_timeChangedListenerCallback");
   native_.callIfPossible(_timeUtilDateTimeChangeListener);
 }
 
 exports.setDateTimeChangeListener = function() {
-  console.log('Entered TimeUtil.setDateTimeChangeListener');
+  utils_.log('Entered TimeUtil.setDateTimeChangeListener');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'changeCallback',
@@ -870,7 +870,7 @@ exports.setDateTimeChangeListener = function() {
 };
 
 exports.unsetDateTimeChangeListener = function() {
-  console.log('Entered TimeUtil.unsetDateTimeChangeListener');
+  utils_.log('Entered TimeUtil.unsetDateTimeChangeListener');
   var result = native_.callSync('TimeUtil_unsetDateTimeChangeListener', {});
   if (native_.isFailure(result)) {
     throw native_.getErrorObject(result);
@@ -881,12 +881,12 @@ exports.unsetDateTimeChangeListener = function() {
 
 var _timeUtilTimezoneChangeListener;
 function _timezoneListenerCallback(eventObj) {
-  console.log("_timezoneListenerCallback");
+  utils_.log("_timezoneListenerCallback");
   native_.callIfPossible(_timeUtilTimezoneChangeListener);
 }
 
 exports.setTimezoneChangeListener = function() {
-  console.log('Entered TimeUtil.setTimezoneChangeListener');
+  utils_.log('Entered TimeUtil.setTimezoneChangeListener');
   var args = validator_.validateMethod(arguments, [
                                                    {
                                                      name : 'changeCallback',
@@ -904,7 +904,7 @@ exports.setTimezoneChangeListener = function() {
 };
 
 exports.unsetTimezoneChangeListener = function() {
-  console.log('Entered TimeUtil.unsetTimezoneChangeListener');
+  utils_.log('Entered TimeUtil.unsetTimezoneChangeListener');
   native_.removeListener('TimezoneChangeListener');
   var result = native_.callSync('TimeUtil_unsetTimezoneChangeListener', {});
   _timeUtilTimezoneChangeListener = undefined;
index 371045546056ce04f4d49762b3b14aa89ac6518a..85fdc33cb438cbdde3a299286e3958b73e15589c 100644 (file)
@@ -3,6 +3,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+var _enableJsLogs = false;
+
 var _global = {};
 if (typeof window != 'undefined') {
   _global = window;
@@ -139,6 +141,12 @@ function Utils() {
   });
 }
 
+Utils.prototype.log = function() {
+  if (_enableJsLogs) {
+    console.log.apply(console, arguments);
+  }
+}
+
 Utils.prototype.repackFilter = function(filter) {
   if (filter instanceof tizen.AttributeFilter) {
     return {