Skip to content

Improve amber logs #346

Description

@faustinoaq

Description

Currently Amber shows request and some response information on logs.

 | DELETE  "/languages/1"  | 14.55ms
Params: _method=delete&id=1
200  | GET  "/languages"  | 1.96ms
Params: 
 | DELETE  "/languages/2"  | 27.49ms
Params: _method=delete&id=2
200  | GET  "/languages"  | 1.66ms
Params: 
 | DELETE  "/languages/3"  | 24.58ms
Params: _method=delete&id=3
200  | GET  "/languages"  | 2.28ms
Params: 
 | DELETE  "/languages/4"  | 24.58ms
Params: _method=delete&id=4
200  | GET  "/languages"  | 1.68ms
Params: 
 | DELETE  "/languages/5"  | 27.02ms
Params: _method=delete&id=5
 | DELETE  "/languages/5"  | 397.0µs
Params: _method=delete&id=5
200  | GET  "/languages"  | 1.45ms

Would be useful to show query data on logs too, just like Rails and Phoenix,

Also adding time and aligned/tabulated logs would be useful and more readable.

Steps to Reproduce

  1. create a new app
  2. run the app
  3. see the logs

Expected behavior: aligned and well spaced logs, also timestamp

Actual behavior: logs spreaded in terminal, using multiple lines and empty Params: without timestamps.

Reproduces how often: 100%

Versions

100%

Additional Information

We can follow Lucky/Kemal logs, or even better logs, using Rails/Phoenix pattern

I personally liked the Lucky logs 👇 However I think we can improve them, Lucky logs still lacks good tabulation and spacing.

screenshot_20171031_143928

screenshot_20171031_145419

@amberframework/contributors WDYT?

Reference: https://github.com/amberframework/granite-orm/issues/86

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions