TypeError: log has no method log #12

Closed
Arnavion opened this Issue Jan 31, 2014 · 3 comments

Comments

Projects
None yet
3 participants

file.js imports './log' as out and then attempts to call out.log. However the function log exported by log.js has no such method.

Full trace is below (I got it when building Typescript via jake but it's not specific to that):

TypeError: Object function (obj) {
  _output(obj, 'info');
} has no method 'log'
    at logger.log (C:\Stuff\Sources\typescript\node_modules\jake\node_modules\utilities\lib\file.js:35:9)
    at EventEmitter.fileUtils.cpR (C:\Stuff\Sources\typescript\node_modules\jake\node_modules\utilities\lib\file.js:251:14)
    at null.action (C:\Stuff\Sources\typescript\Jakefile:300:9)
    at TaskBase.run (C:\Stuff\Sources\typescript\node_modules\jake\lib\task\task.js:199:27)
    at TaskBase.handlePrereqComplete (C:\Stuff\Sources\typescript\node_modules\jake\lib\task\task.js:181:12)
    at null.<anonymous> (C:\Stuff\Sources\typescript\node_modules\jake\lib\task\task.js:149:16)
    at g (events.js:180:16)
    at EventEmitter.emit (events.js:92:17)
    at FileBase.complete (C:\Stuff\Sources\typescript\node_modules\jake\lib\task\file_task.js:92:10)
    at api.complete (C:\Stuff\Sources\typescript\node_modules\jake\lib\api.js:287:15)

I fixed it for myself by adding log.log = log; to log.js

Loglevel 'log' absent in log.js, since file.js have been fixed recently to inculde logger right way, jake functionality is broken now.

kwarismian added a commit to kwarismian/utilities that referenced this issue Jan 31, 2014

Available log methods are bound by the output _levels. Levels was mis…
…sing the basic 'log' level as well as some expected console api methods like warn. Modified to use warn and info for warn and info, and add log to the levels to resolve 'log has no method log' issue #12
Contributor

kwarismian commented Jan 31, 2014

Adding log.log = log isn't necessary. Log.js already defines methods for each assertion level using the _levels method. The original author just neglected to consider regular old "log" a valid level of logging importance. Add , 'log' : 'log' to _levels and you are good to go. Hopefully my pull request (or a similar fix) is implemented soon, as this was a really nasty surprise for my build task yesterday.

mde added a commit that referenced this issue Jan 31, 2014

Merge pull request #13 from kwarismian/master
Fix Issue #12, add unit tests for logging

Arnavion commented Feb 1, 2014

I can confirm that I am able to compile Typescript now. Closing this issue.

@Arnavion Arnavion closed this Feb 1, 2014

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