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

Make server logging comprehensive by including file logging #548

Open
2 tasks done
kaglowka opened this issue Apr 15, 2024 · 1 comment
Open
2 tasks done

Make server logging comprehensive by including file logging #548

kaglowka opened this issue Apr 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@kaglowka
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

I think it'd be a good direction if Empirica included a more comprehensive server logging solution by default such that more detailed information could be logged in a file independently from console output, e.g. by setting different log levels for console logging and file logging. I think it would be reasonable if detailed logging was encouraged as a tool to monitor correct behaviour of the participant tasks during experiments.

That may be a naive question, as I'm not very familiar with js logging solutions, I only know nice solutions using logging module in vanilla Python, which makes me wonder if more comprehensive logging could be easily added to Empirica.

Describe the solution you'd like

An example default setting:

  • there is a .empirica/log.txt file
  • all print functions from @empirica/core/console can produce output in console and/or in the log file
  • by default src/server/index.js sets the console log level to info and log file log level to info/debug

import { info, setLogLevel } from "@empirica/core/console";

Describe alternatives you've considered

Of course it's possible to implement such logging individually (in this particular case I'd need to delve into js logging modules that I don't know myself), but I have an intuition that comprehensive logging would be a very desirable default given the scientific application of Empirica -- so by default we learn about all potential glitches that may have happened during experiments, including any tiny suspicious events within Empirica's inner workings themselves. "debug" and "warn" logging calls for these could be added gradually in the future.

Teachability, Documentation, Adoption, Migration Strategy

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@kaglowka kaglowka added the enhancement New feature or request label Apr 15, 2024
@npaton
Copy link
Contributor

npaton commented Apr 16, 2024

That's a good idea. Often the preferred way to log in server environment is to stdout/stderr, and let the system decide what to do with the logs. But during development at least, it would be nice to have a more verbose log go to a file by default, and if you have a problem, we have more info to work with. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants