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

steroids.logger.log sometimes loses log events #765

Open
pre opened this Issue Jan 19, 2015 · 7 comments

Comments

Projects
None yet
5 participants
@pre
Contributor

pre commented Jan 19, 2015

Workaround: tail -f log/steroids.log

Log events seem only be missing from the Connect Screen (in the browser).

@benadamstyles

This comment has been minimized.

Contributor

benadamstyles commented Jan 19, 2015

Seems to be that this happens when called from the .then() method of a Promise. Could this be feasible? I could easily be wrong though, and I don't think it happens all the time even in this circumstance. I'll report back if I find out more.

@pre

This comment has been minimized.

Contributor

pre commented Feb 13, 2015

From forums:

It seems that if you abstract the call to logger.log and wrap it over a setTimeout then the log messages will always arrive. Ie.

setTimeout(function(){
    supersonic.logger.log('y hellow' );
},1);
@terwey

This comment has been minimized.

terwey commented Feb 14, 2015

I'm also experiencing this issue. I am unable to log at all unless using the setTimeout() trick.

@battmanz

This comment has been minimized.

battmanz commented Feb 24, 2015

I tried the setTimeout trick and sometimes it works, sometimes it doesn't. Even when it does work, I do not see the log on the connect screen. I can only see it if I open up the steroids.log file. I'm on Windows 8, by the way.

@benadamstyles

This comment has been minimized.

Contributor

benadamstyles commented Feb 25, 2015

Yep same here. I've pretty much stopped using it altogether, which is unfortunate as alerts are less than ideal!

@pre

This comment has been minimized.

Contributor

pre commented Feb 25, 2015

Just to clarify: Can you see the missing lines in steroids.log? Ie. are the log lines missing only from the Connect Screen (in browser) or also from the log file?

As a workaround, you can use tail -f log/steroids.log -- afaik, the log events are only missing in the browser. Please report here if that's not true.

@RPieter

This comment has been minimized.

RPieter commented Jan 24, 2016

From what I can see, they're not in the steroids.log-file.

My testcase:

angular
  .module('POC')
  .controller("TestController", function ($scope, supersonic) {
    $scope.detectedPlatform = 'detecting...';
    $scope.start = function () {
        supersonic.logger.debug('start license check');
        supersonic.device.platform().then(function (platform) {
            supersonic.logger.debug(
                "Name: " + platform.name + "\n" +
                "Version: " + platform.version + "\n" +
                "Model: " + platform.model
            );
            $scope.detectedPlatform = platform.name;
        });
    }
});

The first debug-line start license check is NOT logged (not in file, nor in connect-screen), the second line (device-info) IS shown.

So it looks like a timing-issue.
However, the setTimeout workaround doesn't help in this case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment