ENYO-2090:add log-to file & smart loging to the ide server #246

Merged
merged 5 commits into from Mar 30, 2013

Conversation

Projects
None yet
2 participants
@asnowfix
Member

asnowfix commented Mar 29, 2013

  • server-siode code only: no test needed in the browser
  • developed & tested on OSX
  • ENYO-2047: remove non-existing temp files from .gitignore (HEAD, enyojs/ENYO-2090, ENYO-2090)
  • ENYO-2090: replace console.log by npmlog & allow log to file
  • ENYO-2090: Add a dependency on npmlog

Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI francois-xavier.kowalski@hp.com

asnowfix added some commits Mar 29, 2013

ENYO-2090: Add a dependency on npmlog
- add to package.json
- re-run `npm shrinkwrap`

Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI <francois-xavier.kowalski@hp.com>
ENYO-2090: replace console.log by npmlog & allow log to file
- replace '-v' option by `--level XXX` to use npmlog
- add `-L` option to active logging to a file `ide.log`
- update usage instructions accordingly, add bug reporting instructions

Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI <francois-xavier.kowalski@hp.com>
ENYO-2047: remove non-existing temp files from `.gitignore`
- This is no longer needed, so we prefer that Git has a real view on the
  workspace.

Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI <francois-xavier.kowalski@hp.com>

@ghost ghost assigned yves-del-medico Mar 29, 2013

ide.js
- }
- msg += ' ';
+log.level = argv.level || 'http';
+if (argv.out) {

This comment has been minimized.

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

It should be argv.log instead of argv.out.

So "node ide.js --log" or "node ide.js -L" does not generate an ide.log

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

It should be argv.log instead of argv.out.

So "node ide.js --log" or "node ide.js -L" does not generate an ide.log

This comment has been minimized.

@asnowfix

asnowfix Mar 30, 2013

Member

good catch. it use to be out on my dev branch...

@asnowfix

asnowfix Mar 30, 2013

Member

good catch. it use to be out on my dev branch...

ide.js
return function(data){
- console.log("> Service['"+service.id+"']: "+data);
+ log.warn(service.id, data);

This comment has been minimized.

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Data is shown as a byte array which is not useful.

ares WARN home <Buffer 54 72 61 63 65 3a 20 46 73 4c 6f 63 61 6c 2e 65 72 72 6f 72 52 65 73 70 6f 6e 73 65 28 29 0a 20 20 20 20 61 74 20 46 73 4c 6f 63 61 6c 2e 65 72 72 6f 72 ...>

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Data is shown as a byte array which is not useful.

ares WARN home <Buffer 54 72 61 63 65 3a 20 46 73 4c 6f 63 61 6c 2e 65 72 72 6f 72 52 65 73 70 6f 6e 73 65 28 29 0a 20 20 20 20 61 74 20 46 73 4c 6f 63 61 6c 2e 65 72 72 6f 72 ...>

This comment has been minimized.

@asnowfix

asnowfix Mar 30, 2013

Member

_ ares WARN home_ ?

@asnowfix

asnowfix Mar 30, 2013

Member

_ ares WARN home_ ?

This comment has been minimized.

@asnowfix

asnowfix Mar 30, 2013

Member

Trampoline are now log.xxx(yyy, data.toString())

@asnowfix

asnowfix Mar 30, 2013

Member

Trampoline are now log.xxx(yyy, data.toString())

ide.js
-function serviceEcho(service) {
+function serviceOut(service) {
+ return function(data){
+ log.info(service.id, data);

This comment has been minimized.

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Default level (http )is not enough to log message coming from sub-processes.

Data is displayed as a byte array.

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Default level (http )is not enough to log message coming from sub-processes.

Data is displayed as a byte array.

This comment has been minimized.

@asnowfix

asnowfix Mar 30, 2013

Member

Will use http as the log-level for messages coming from the sub-processes.

@asnowfix

asnowfix Mar 30, 2013

Member

Will use http as the log-level for messages coming from the sub-processes.

ide.js
}
// Exit path
-console.info("Press CTRL + C to shutdown");
+log.info('main', "Press CTRL + C to shutdown");
process.on('uncaughtException', function (err) {
console.error(err.stack);

This comment has been minimized.

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Should also go thru npmlog

@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Should also go thru npmlog

ENYO-2090: Fix review comments
Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI <francois-xavier.kowalski@hp.com>
@asnowfix

This comment has been minimized.

Show comment
Hide comment
@asnowfix

asnowfix Mar 30, 2013

Member
  1. review comments fixed
  2. tested on win7/x64

ready to merge

Member

asnowfix commented Mar 30, 2013

  1. review comments fixed
  2. tested on win7/x64

ready to merge

yves-del-medico added a commit that referenced this pull request Mar 30, 2013

Merge pull request #246 from enyojs/ENYO-2090
ENYO-2090:add log-to file & smart loging to the ide server

@yves-del-medico yves-del-medico merged commit 597ffca into master Mar 30, 2013

@yves-del-medico

This comment has been minimized.

Show comment
Hide comment
@yves-del-medico

yves-del-medico Mar 30, 2013

Member

Merged

Member

yves-del-medico commented Mar 30, 2013

Merged

@yves-del-medico

This comment has been minimized.

Show comment
Hide comment
@yves-del-medico

yves-del-medico Mar 30, 2013

Member

I forgot one comment; color should be disabled when -L or --log is specified.
This is true for ide.js and sub-processes.

Member

yves-del-medico commented Mar 30, 2013

I forgot one comment; color should be disabled when -L or --log is specified.
This is true for ide.js and sub-processes.

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