You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@giordano suggests that when we run tests and call functions that log something with the logger, those messages shouldn't go in the same logger as the production ones. He suggests one solution could be functions that use the logger should be passed the logger, defaulting to the global logger so it's not necessary to always pass an instance of the logger when calling the function.
@raquel-ucl suggests do one of these three:
Leave as is, since it's unclear why logging in testing mode by us developers would need to be different than non-test mode development testing. Users will never run tests, and we'll never run in production.
Configure the logger (if possible, I haven’t checked! You can do it in log4j and others though) to look into:
the trace, so if it’s called from the tests classes it uses a different file/logger; or
the environment, so we have a production and a test environment, and the logger acts accordingly
Pass the logger to the constructors, not the functions (which can be problematic for future development, e.g. functions which are not logging anything but are in turn calling functions that do need a logger). Ideally we can use dependency injection but that is less simple to implement.
We need to have a conversation about this because something might have been lost in Slack comms!
The text was updated successfully, but these errors were encountered:
We considered having 2 separate logs: one containing the global user log, and one containing the logs produced by the tests. However this makes it very complicated to assert the correctness of the log content in the tests.
We have decided that:
Testing that will also include asserting the log contents are correct, will keep on using temporary logs as it is now.
Testing that produces log that might be useful in the future, like the communication with the server, we will kept in a secondary test log.
If the secondary test log can't be done smoothly, worst case scenario would be to use the global user log. We'll try to avoid this, though.
@giordano suggests that when we run tests and call functions that log something with the logger, those messages shouldn't go in the same logger as the production ones. He suggests one solution could be functions that use the logger should be passed the logger, defaulting to the global logger so it's not necessary to always pass an instance of the logger when calling the function.
@raquel-ucl suggests do one of these three:
We need to have a conversation about this because something might have been lost in Slack comms!
The text was updated successfully, but these errors were encountered: