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

Error formating numbers #21

Open
Toub opened this issue Jun 19, 2016 · 2 comments
Open

Error formating numbers #21

Toub opened this issue Jun 19, 2016 · 2 comments

Comments

@Toub
Copy link

Toub commented Jun 19, 2016

Looks like the numbers formatter always fails when using decimals.
It should never fail, even if the decimal is not provided.

   $log.getInstance('main').info('===> This works: "%s"', "string text");
   $log.getInstance('main').info('===> This fails: "%d"', 10);

Stack trace:

"June 19, 2016 3:44 PM::[main]> " "Error: [sprintf] expecting number but found undefined
[4]</</sprintf.format@http://localhost:3000/bower_components/angular-logger/dist/angular-logger.js:3893:1
sprintf@http://localhost:3000/bower_components/angular-logger/dist/angular-logger.js:3860:16
[2]</</LoggingEnhancer/self.countSprintfHolders@http://localhost:3000/bower_components/angular-logger/dist/angular-logger.js:215:1
maybeApplySprintf@http://localhost:3000/bower_components/angular-logger/dist/angular-logger.js:158:31
enhanceLogline@http://localhost:3000/bower_components/angular-logger/dist/angular-logger.js:149:25
[2]</</LoggingEnhancer/this.enhanceLogging/<@http://localhost:3000/bower_components/angular-logger/dist/angular-logger.js:122:30
[...]
" "===> This fails: "%d"" 10
@bbottema bbottema added the bug label Jun 20, 2016
@bbottema
Copy link
Member

@Toub angular-logger uses whatever version of sprintf you are currently using. It seems an issue with sprintf. Can you try with some other versions as well?

On a sidenote, I also released a new patch version, 1.3.2.

@bbottema bbottema removed the bug label Jul 22, 2016
@david-hollifield
Copy link

I know this is a long time ago, but I'm getting the same error.

This fails: this.$log.debug("cropAspectRatio => %f", this.cropAspectRatio);
This works: this.$log.debug(sprintf("cropAspectRatio => %f", this.cropAspectRatio));

i'm no sure what's going on. I'm using 1.3.2 of angular-logger and 1.1.2 of sprintf-js

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

No branches or pull requests

3 participants