зеркало из https://github.com/microsoft/gather.git
Log: fix log event POST format
This commit is contained in:
Родитель
ac5048ac60
Коммит
b076913b10
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@andrewhead/gather",
|
||||
"version": "0.2.0",
|
||||
"name": "gather",
|
||||
"version": "0.2.1",
|
||||
"description": "Tools for cleaning and recovering code in Jupyter Lab",
|
||||
"author": "",
|
||||
"main": "lib/lab/index.js",
|
||||
|
|
|
@ -95,13 +95,16 @@ export function log(eventName: string, data?: any) {
|
|||
}
|
||||
}
|
||||
|
||||
// Submit data to logger endpoint.
|
||||
_ajaxCaller.ajax(LOG_ENDPOINT + "/save", {
|
||||
// If there is any sensitive data to be logged, it should first be cleaned through a
|
||||
// `toJSON` method defined on a class, or manually before passing it into this method.
|
||||
// Earlier, we used the replacer argument to JSON.stringify, but it takes too much time
|
||||
// to apply replacers to every value in the resulting JSON.
|
||||
data: JSON.stringify(postData),
|
||||
postData.data = JSON.stringify(postData.data);
|
||||
|
||||
// Submit data to logger endpoint.
|
||||
_ajaxCaller.ajax(LOG_ENDPOINT + "/save", {
|
||||
|
||||
data: JSON.parse(JSON.stringify(postData)),
|
||||
method: "POST",
|
||||
error: (_: any, textStatus: string, errorThrown: string) => {
|
||||
console.error("Failed to log", textStatus, errorThrown);
|
||||
|
|
Загрузка…
Ссылка в новой задаче