Ghost/core/server/helpers
Katharina Irrgang 1882278b5b 🎨 configurable logging with bunyan (#7431)
- 🛠  add bunyan and prettyjson, remove morgan

-   add logging module
  - GhostLogger class that handles setup of bunyan
  - PrettyStream for stdout

-   config for logging
  - @TODO: testing level fatal?

-   log each request via GhostLogger (express middleware)
  - @TODO: add errors to output

- 🔥  remove errors.updateActiveTheme
  - we can read the value from config

- 🔥  remove 15 helper functions in core/server/errors/index.js
  - all these functions get replaced by modules:
    1. logging
    2. error middleware handling for html/json
    3. error creation (which will be part of PR #7477)

-   add express error handler for html/json
  - one true error handler for express responses
  - contains still some TODO's, but they are not high priority for first implementation/integration
  - this middleware only takes responsibility of either rendering html responses or return json error responses

- 🎨  use new express error handler in middleware/index
  - 404 and 500 handling

- 🎨  return error instead of error message in permissions/index.js
  - the rule for error handling should be: if you call a unit, this unit should return a custom Ghost error

- 🎨  wrap serve static module
  - rule: if you call a module/unit, you should always wrap this error
  - it's always the same rule
  - so the caller never has to worry about what comes back
  - it's always a clear error instance
  - in this case: we return our notfounderror if serve static does not find the resource
  - this avoid having checks everywhere

- 🎨  replace usages of errors/index.js functions and adapt tests
  - use logging.error, logging.warn
  - make tests green
  - remove some usages of logging and throwing api errors -> because when a request is involved, logging happens automatically

- 🐛  return errorDetails to Ghost-Admin
  - errorDetails is used for Theme error handling

- 🎨  use 500er error for theme is missing error in theme-handler

- 🎨  extend file rotation to 1w
2016-10-04 16:33:43 +01:00
..
tpl Subscribers: router & form helpers 2016-05-11 10:28:11 +02:00
asset.js Rename confusing 'context' variables 2016-02-21 22:07:15 +00:00
author.js 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
body_class.js deps: lodash@4.13.1 2016-06-11 13:13:55 -06:00
content.js
date.js timezones: Always use the timezone of blog setting 2016-05-20 13:59:45 +02:00
encode.js Rename confusing 'context' variables 2016-02-21 22:07:15 +00:00
excerpt.js Rename confusing 'context' variables 2016-02-21 22:07:15 +00:00
facebook_url.js Add helpers for facebook & twitter urls 2016-05-17 16:39:58 +01:00
foreach.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
get.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
ghost_foot.js
ghost_head.js 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
has.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
image.js 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
index.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
input_email.js Subscribers: router & form helpers 2016-05-11 10:28:11 +02:00
input_password.js
is.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
meta_description.js Started moving meta data fetching to functions. 2016-01-23 13:58:21 -08:00
meta_title.js Started moving meta data fetching to functions. 2016-01-23 13:58:21 -08:00
navigation.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
page_url.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
pagination.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
plural.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
post_class.js Remove filters from theme helpers (no async) 2015-12-08 14:35:04 +00:00
prev_next.js Rename confusing 'context' variables 2016-02-21 22:07:15 +00:00
tags.js 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
template.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
title.js
twitter_url.js Add helpers for facebook & twitter urls 2016-05-17 16:39:58 +01:00
url.js Started moving meta data fetching to functions. 2016-01-23 13:58:21 -08:00
utils.js Update tags & foreach to respect visibility 2016-06-15 12:37:09 +01:00