Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better logging #22

Closed
6 tasks
DavidGOrtega opened this issue Mar 24, 2020 · 8 comments · Fixed by #703
Closed
6 tasks

Better logging #22

DavidGOrtega opened this issue Mar 24, 2020 · 8 comments · Fixed by #703
Assignees
Labels
p1-important High priority technical-debt Refactoring, linting & tidying ui/ux User interface/experience

Comments

@DavidGOrtega
Copy link
Contributor

DavidGOrtega commented Mar 24, 2020

Use a proper logging library

@0x2b3bfa0 moved the rest of items to a separate issue, as @casperdcl suggested in the past weekly meeting.

Click to see the original text...

nice to have

(put in separate issue)

  • wrap specific CI vendor capabilities
  • heartbeats (in openmetrics format?)
  • file configurable
  • integration with studio

Edit:
Coming back to this we should now, with the 0.3.0 release, attack this.
The proposal would be use winston and a configurable file. We can also collect runner heartbeat using openmetrics format

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented May 21, 2021

cml/bin/cml-pr.js

Lines 3 to 4 in c61fe70

const print = console.log;
console.log = console.error;

🤯
#define struct union
#define if while
#define else
#define break
#define if(x)
#define double float
#define volatile

#define M_PI 3.2f
#undef FLT_MIN
#define FLT_MIN (-FLT_MAX)
#define floor ceil
#define isnan(x) false
#define true ((__LINE__&15)!=15)
#define true ((rand()&15)!=15)
#define if(x) if ((x) && (rand() < RAND_MAX * 0.99))

#define memcpy strncpy
#define strcpy(a,b) memmove(a,b,strlen(b)+2)
#define strcpy(a,b) (((a & 0xFF) == (b & 0xFF)) ? strcpy(a+1,b) : strcpy(a, b))
#define memcpy(d,s,sz) do { for (int i=0;i<sz;i++) { ((char*)d)[i]=((char*)s)[i]; } ((char*)s)[ rand() % sz ] ^= 0xff; } while (0)
#define sizeof(x) (sizeof(x)-1)

@DavidGOrtega
Copy link
Contributor Author

@0x2b3bfa0 I dont fully follow you 😁

@DavidGOrtega
Copy link
Contributor Author

DavidGOrtega commented May 21, 2021

If you are wondering what is does is prevent other libraries to output in std with console.log. Take into account that console.log is used even is you dont want to

@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented May 21, 2021

Thanks! I was wondering (admittedly, with a bit of humor) if we could avoid monkey-patching once we improve logging. The current approach is equally useful and puzzling if you overlook those lines.

@DavidGOrtega
Copy link
Contributor Author

Yeah, JS and its weirdness. Mostly all the logging libs do this internally

@casperdcl casperdcl changed the title [cml-runner] - Better logging Better logging Jul 20, 2021
@casperdcl casperdcl added the p1-important High priority label Jul 20, 2021
@0x2b3bfa0 0x2b3bfa0 assigned 0x2b3bfa0 and unassigned DavidGOrtega and 0x2b3bfa0 Aug 31, 2021
@0x2b3bfa0 0x2b3bfa0 added technical-debt Refactoring, linting & tidying ui/ux User interface/experience and removed cml-runner Subcommand labels Aug 31, 2021
@0x2b3bfa0
Copy link
Member

0x2b3bfa0 commented Aug 31, 2021

@DavidGOrtega, feel free to create a new issue starting from the following template and elaborating on each idea, if opportune:

Follow-up of #22

  • wrap specific CI vendor capabilities
  • heartbeats (in openmetrics format?)
  • file configurable
  • integration with studio

The proposal would be use winston and a configurable file. We can also collect runner heartbeat using openmetrics format.

@DavidGOrtega
Copy link
Contributor Author

This could be maintained as an epic?

@0x2b3bfa0
Copy link
Member

I plan to create a new follow-up epic from #703 and we can include all the relevant issues there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-important High priority technical-debt Refactoring, linting & tidying ui/ux User interface/experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants