{"action":"opened","issue":{"url":"https://api.github.com/repos/christianalfoni/cerebral/issues/133","labels_url":"https://api.github.com/repos/christianalfoni/cerebral/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/christianalfoni/cerebral/issues/133/comments","events_url":"https://api.github.com/repos/christianalfoni/cerebral/issues/133/events","html_url":"https://github.com/christianalfoni/cerebral/issues/133","id":116719691,"number":133,"title":"Feature: Expose a new param on actions that contains env/meta data about the signal & action path.","user":{"login":"jeroenverfallie","id":1143308,"avatar_url":"https://avatars.githubusercontent.com/u/1143308?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroenverfallie","html_url":"https://github.com/jeroenverfallie","followers_url":"https://api.github.com/users/jeroenverfallie/followers","following_url":"https://api.github.com/users/jeroenverfallie/following{/other_user}","gists_url":"https://api.github.com/users/jeroenverfallie/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroenverfallie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroenverfallie/subscriptions","organizations_url":"https://api.github.com/users/jeroenverfallie/orgs","repos_url":"https://api.github.com/users/jeroenverfallie/repos","events_url":"https://api.github.com/users/jeroenverfallie/events{/privacy}","received_events_url":"https://api.github.com/users/jeroenverfallie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-13T07:52:29Z","updated_at":"2015-11-13T07:52:29Z","closed_at":null,"body":"## Case\r\n\r\nWhen working with cerebral in production, I add loggers to every error path in the signals.\r\nThese loggers trigger an error to a remote service, such a Rollbar, Sentry, TrackJs, ... \r\n\r\nWhen logging these, I try to provide a meaningful namespace, so the error can be located & fixed easily.\r\n\r\nTake this example logging factory:\r\n```js\r\nexport default function(namespace) {\r\n    return function logToRollbar(input) {\r\n        if (window.Rollbar) {\r\n            window.Rollbar.error('Custom :: ' + namespace, input);\r\n        } else {\r\n            console.warn('Rollbar::', namespace, input);\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nAnd this example signal:\r\n```js\r\ncontroller.signal('submitCredentials', [\r\n    persistCredentials,\r\n    [\r\n        postCredentialsInternal, {\r\n            success: [saveInternalUID],\r\n            error: [logToRollbar('submitCredentials.postCredentialsInternal')]\r\n        },\r\n        postCredentialsCrm, {\r\n            success: [saveCrmUID],\r\n            error: [logToRollbar('submitCredentials.postCredentialsCrm')]\r\n        }\r\n    ]\r\n]);\r\n```\r\n\r\nThis gives us a nice error such as: (silly example)\r\n![_7_custom____submitcredentials_postcredentialscrm_-_rollbar](https://cloud.githubusercontent.com/assets/1143308/11141160/e10c882c-89e2-11e5-8dc0-3ae28e9bbe9c.png)\r\n\r\n![_7_custom____submitcredentials_postcredentialscrm_-_rollbar](https://cloud.githubusercontent.com/assets/1143308/11141181/206cdd64-89e3-11e5-841a-c0b24f955535.png)\r\n\r\n## Feature Request\r\n\r\nInstead of manually providing a namespace, it would be nice to get a stack/path of the current signal/action/outputPath.\r\n\r\nFor example..\r\n````\r\n// When triggered on \"postCredentialsCrm:error\"\r\nfunction logToRollbar(input, state, output, services, stack) {\r\n    // stack = ['submitCredentials', 'postCredentialsCrm', 'error'];\r\n    // And further levels, including the full signal name with its namespace if included.\r\n}\r\n```\r\n\r\n\r\n----\r\n\r\nDiscuss!"}}