Browse Source

Adding more logs and translating them to english

master
GabrielTrettel 3 years ago
parent
commit
3103620fe0
  1. 1
      src/app/components/forms/AssembleIngestionObject.js
  2. 2
      src/app/hooks/useFiltering.js
  3. 10
      src/app/hooks/useSocketMarkers.js

1
src/app/components/forms/AssembleIngestionObject.js

@ -11,6 +11,7 @@ async function AssembleIngestionObject(
time,
address
) {
console.log(`----> Sending data: ${code} = ${situation} => ${moment().format('DD/MM, h:mm:ss:SSS')}`)
const ingestionObject = {
responseData: {
array_to_json: [

2
src/app/hooks/useFiltering.js

@ -6,7 +6,7 @@ function useFiltering(location) {
const initialDate = moment().add(1, "days").format("YYYY-MM-DDTHH:mm:ss");
const finalDate = moment().subtract(1, "days").format("YYYY-MM-DDTHH:mm:ss");
console.log(`Criando sockets do useFiltering: ${moment().format('DD/MM, h:mm:ss:SSS')}`);
console.log(`Opening all sockets on useFiltering: ${moment().format('DD/MM, h:mm:ss:SSS')}`);
const filters = [
{

10
src/app/hooks/useSocketMarkers.js

@ -165,15 +165,19 @@ function getFormsAnswers(socketObject, dispatch) {
const [timerCounter, setTimer] = useState(1);
const openListeners = () => {
// console.log(`rodando forms answ ${socketObject.name}`);
socketObject.socketUrl.onerror = (e) => {
console.log(e.message);
};
socketObject.socketUrl.onmessage = ({ data }) => {
console.log(`\t ====== Recebendo dados: ${socketObject.name} => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
console.log(`\t ====== Getting data from: ${socketObject.name} => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
setSocketResponse(data);
};
socketObject.socketUrl.onclose = () => {
console.log(`\t ====== Socket closed : ${socketObject.name} => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
}
};
openListeners();
@ -181,7 +185,7 @@ function getFormsAnswers(socketObject, dispatch) {
// Actually closing/opening sockets every 10min
useEffect(() => {
if (timerCounter % 10 == 0) {
console.log(`========> Deletando e criando sockets: ${socketObject.name} => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
console.log(`========> Closing/Opening socket: ${socketObject.name} => ${moment().format('DD/MM, h:mm:ss:SSS')}`);
socketObject.socketUrl.close();
socketObject.socketUrl = new WebSocket(socketObject.url);
openListeners();

Loading…
Cancel
Save