{app} = if process.type is 'browser' then electron else electron.remote
@productName ?= app.getName()
- companyName ?= 'GitHub, Inc'
- submitURL ?= 'http://54.249.141.255:1127/post'
autoSubmit ?= true
ignoreSystemCrashHandler ?= false
extra ?= {}
extra._companyName ?= companyName
extra._version ?= app.getVersion()
+ unless companyName?
+ deprecate.log('companyName is now a required option to CrashReporter::start')
+ return
+
+ unless submitURL?
+ deprecate.log('submitURL is now a required option to CrashReporter::start')
+ return
+
start = => binding.start @productName, companyName, submitURL, autoSubmit, ignoreSystemCrashHandler, extra
if process.platform is 'win32'
path.join tmpdir, "#{@productName} Crashes", 'uploads.log'
binding._getUploadedReports log
-
crashRepoter = new CrashReporter
module.exports = crashRepoter
# Print deprecate warning.
deprecate.warn = (oldName, newName) ->
- message = "#{oldName} is deprecated. Use #{newName} instead."
+ deprecate.log("#{oldName} is deprecated. Use #{newName} instead.")
+
+# Print deprecation message
+deprecate.log = (message) ->
if process.throwDeprecation
throw new Error(message)
else if process.traceDeprecation
else
console.warn "(electron) #{message}"
+
module.exports = deprecate