Updated Branches: refs/heads/master d39c1fee2 -> 0588dd318
[ios] [CB-2824] Remove iOS DebugConsole plugin Use cordova.logger instead. Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/0588dd31 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/0588dd31 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/0588dd31 Branch: refs/heads/master Commit: 0588dd318be2e2b744d8ba694666b11a235e6e5d Parents: d39c1fe Author: Ian Clelland <[email protected]> Authored: Sat Mar 30 22:59:36 2013 -0400 Committer: Andrew Grieve <[email protected]> Committed: Thu Apr 4 15:41:13 2013 -0400 ---------------------------------------------------------------------- lib/ios/plugin/ios/console.js | 93 ---------------------------- lib/ios/plugin/ios/console/symbols.js | 23 ------- lib/ios/plugin/ios/logger/symbols.js | 24 +++++++ 3 files changed, 24 insertions(+), 116 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/0588dd31/lib/ios/plugin/ios/console.js ---------------------------------------------------------------------- diff --git a/lib/ios/plugin/ios/console.js b/lib/ios/plugin/ios/console.js deleted file mode 100644 index 82ff059..0000000 --- a/lib/ios/plugin/ios/console.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - * -*/ - -var exec = require('cordova/exec'); - -/** - * create a nice string for an object - */ -function stringify(message) { - try { - if (typeof message === "object" && JSON && JSON.stringify) { - try { - return JSON.stringify(message); - } - catch (e) { - return "error JSON.stringify()ing argument: " + e; - } - } else { - return (typeof message === "undefined") ? "undefined" : message.toString(); - } - } catch (e) { - return e.toString(); - } -} - -/** - * Wrapper one of the console logging methods, so that - * the Cordova logging native is called, then the original. - */ -function wrappedMethod(console, method) { - var origMethod = console[method]; - - return function() { - - var args = [].slice.call(arguments), - len = args.length, - i = 0, - res = []; - - for ( ; i < len; i++) { - res.push(stringify(args[i])); - } - - exec(null, null, - 'Debug Console', 'log', - [ res.join(' '), { logLevel: method.toUpperCase() } ] - ); - - if (!origMethod) return; - - origMethod.apply(console, arguments); - }; -} - -var console = window.console || {}; - -// 2012-10-06 pmuellr - marking setLevel() method and logLevel property -// on console as deprecated; -// it didn't do anything useful, since the level constants weren't accessible -// to anyone - -console.setLevel = function() {}; -console.logLevel = 0; - -// wrapper the logging messages - -var methods = ["log", "debug", "info", "warn", "error"]; - -for (var i=0; i<methods.length; i++) { - var method = methods[i]; - - console[method] = wrappedMethod(console, method); -} - -module.exports = console; http://git-wip-us.apache.org/repos/asf/cordova-js/blob/0588dd31/lib/ios/plugin/ios/console/symbols.js ---------------------------------------------------------------------- diff --git a/lib/ios/plugin/ios/console/symbols.js b/lib/ios/plugin/ios/console/symbols.js deleted file mode 100644 index f6898fb..0000000 --- a/lib/ios/plugin/ios/console/symbols.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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. - * -*/ - -var modulemapper = require('cordova/modulemapper'); - -modulemapper.clobbers('cordova/plugin/ios/console', 'console'); http://git-wip-us.apache.org/repos/asf/cordova-js/blob/0588dd31/lib/ios/plugin/ios/logger/symbols.js ---------------------------------------------------------------------- diff --git a/lib/ios/plugin/ios/logger/symbols.js b/lib/ios/plugin/ios/logger/symbols.js new file mode 100644 index 0000000..f6ea2f8 --- /dev/null +++ b/lib/ios/plugin/ios/logger/symbols.js @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + * +*/ + + +var modulemapper = require('cordova/modulemapper'); + +modulemapper.clobbers('cordova/plugin/logger', 'console');
