//Include module
var base = require("../lib/index.js");

/**
 * To use crashreporter in your project is pretty simple just call base.crashreporter()
 * Module will create crashreporter with configuration established
 * in default config "./options.json (crashreporter)" or specified by you using base.setDefaultOptions()
 * in any point before this (see: templates/express)
 */
base.crashreporter();

/**
 * You can also specify custom setting, what have this different from default
 */
base.crashreporter({
    "exitOnCrash": [false],
    "maxCrashFile": [5],
    "mailEnabled": true,
    "outDir" : "../logs",
    "mailConfig": {
        "subject": "New crash resport",
        "from": "creshreporter@node_base_module.com",
        "to": "target@domain.com"
    } 
});

/**
 * Sample exemple change from default just "mailSubject"
 */
base.crashreporter({
    "mailConfig": {
        "subject": "New message from list above"
    } 
});

/**
 * This will automaticaly catch all uncatch exception and send a mail witt exception
 */