Skip to content
Myr

Updated Express.Logger

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 417fd10 · Browse files · 1 file+35 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+35 added−4 removed

  • other:+35 added−4 removed

1 file+35 added−4 removed

modified:lib/express.core.js+35 added-4 removed
50 unmodified lines
51 }52 }53 },54 55 DefaultContentType : {56 onRequest : {57 'set content type to text/html' : function() {58 Express.header('Content-Type', 'text/html')59 }60 }61 },62 63 Logger : {64 onRequest : {65 'output log data' : function(){66 puts('"' + Express.request.method + ' ' + Express.request.uri.path +67 ' HTTP/' + Express.request.httpVersion + '" - ' + Express.response.status)68 }69 }70 },71 72 /**73 * Invoke hook _name_ with _args_, returning74 * an array of return values.75 *
522 unmodified lines
598 },599 600 display : function(path) {601 585 },586 587 Logger : function(request, response){588 puts('"' + request.method + ' /' + request.uri.path + ' HTTP/' + request.httpVersion + '" - ' + Express.response.status)602 }603 }604 605 // --- Utilities
9 unmodified lines
615 // --- Core Modules616 617 use(Express.RedirectHelpers)618 use(Express.ContentLength)619 use(Express.DefaultContentType)620 621})()622623use(Express.Logger)624625get('login', function(){626 ' \627 <form action="/" method="post"> \628 <label>Username:</label> \629 <input type="text" name="user[name]"> \630 <label>Password:</label> \631 <input type="password" name="user[password]"> \632 <input type="submit" name="op" value="Login"> \633 <input type="submit" name="op" value="Cancel"> \634 </form> \635 ' 636})637638Express.start()