Open source project to tackle the problem of long development cycles required to produce software to conduct multi-participant and real-time human experiments online.
Logging using empirica/core/console doesn't initially print data in the console. Logs are displayed only on hot reload.
I loaded (from a file) external additional data used in my experiment and I tried to print some information on it in the console, so I see what data the current Empirica server uses.
I don't know what's the reason. As you can see below I tried to log both in the main thread as well as within a new thread.
I imagine any of these two solutions would be more than fine:
change the behaviour so the code above produces output immediately
add a special callback run on full server initialization (such as Meteor.startup() in Empirica 1 where such logging or any time-consuming operations could be done after Empirica core server is already responsive & running.
Steps To Reproduce
create new experiment project
add in index.js or callbacks.js
import { info, error} from "@empirica/core/console";
function printSync() {
info('output 1')
error('output 2')
console.info('output 3')
console.error('output 4')
}
function printAsync() {
info('output 5')
error('output 6')
console.info('output 7')
console.error('output 8')
}
printSync();
(async () => printAsync())();
**Output**
[server] output 4
[server] output 8
Empirica (build #208) server running:
Player http://localhost:3000
Admin http://localhost:3000/admin
On adding any change to the file and saving:
14:10:10.514 ERR callbacks: exited, retrying error="exit status 1"
[server] building file list ...
[server] 0 files to consider
[server] 14:10:12.016 INF output 1
[server] 14:10:12.017 ERR output 2
[server] output 3
[server] output 4
[server] 14:10:12.018 INF output 5
[server] 14:10:12.018 ERR output 6
[server] output 7
[server] output 8
[server] 14:10:12.433 INF server: started
server refreshed
### Empirica Version
```text
1.10
What OS are you seeing the problem on?
Linux (Ubuntu 22.04)
What browser are you seeing the problem on?
Does not apply
Relevant log output
No response
Anything else?
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Startup logs are indeed muted at startup. You should be able to get back startup logs with --log.level debug. I will look into always printing logs at startup.
Is there an existing issue for this?
What happened?
Logging using empirica/core/console doesn't initially print data in the console. Logs are displayed only on hot reload.
I loaded (from a file) external additional data used in my experiment and I tried to print some information on it in the console, so I see what data the current Empirica server uses.
I don't know what's the reason. As you can see below I tried to log both in the main thread as well as within a new thread. I imagine any of these two solutions would be more than fine:
Meteor.startup()
in Empirica 1 where such logging or any time-consuming operations could be done after Empirica core server is already responsive & running.Steps To Reproduce
index.js
orcallbacks.js
printSync(); (async () => printAsync())();
[server] output 4 [server] output 8
Empirica (build #208) server running:
14:10:10.514 ERR callbacks: exited, retrying error="exit status 1" [server] building file list ... [server] 0 files to consider [server] 14:10:12.016 INF output 1 [server] 14:10:12.017 ERR output 2 [server] output 3 [server] output 4 [server] 14:10:12.018 INF output 5 [server] 14:10:12.018 ERR output 6 [server] output 7 [server] output 8 [server] 14:10:12.433 INF server: started server refreshed
What OS are you seeing the problem on?
Linux (Ubuntu 22.04)
What browser are you seeing the problem on?
Does not apply
Relevant log output
No response
Anything else?
Code of Conduct