Skip to content

Commit

Permalink
Merge pull request #186 from dbfannin/authorize_custom_timestamps
Browse files Browse the repository at this point in the history
Authorize custom timestamps formats
  • Loading branch information
qortex committed Apr 16, 2020
2 parents f75884c + 23802dc commit f4f0c9c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - Merged features waiting to be published in upcoming version

- None at the time.

## [4.1.5] - 2020-04-16

### Fixed

- Now support custom format timestamps in addition to pre-defined ones in Angular [@qortex](https://github.com/qortex). Fixes #178.
5 changes: 2 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ export class YourComponent {
- serverLoggingUrl {string}: URL to POST logs.
- httpResponseType {'arraybuffer' | 'blob' | 'text' | 'json'}: the response type of the HTTP Logging request.
- enableSourceMaps {boolean}: enables manual parsing of Source Maps
- Note: In order for the enableSourceMaps flag to work, your app must generate the source maps during the build process. If your using AngularCli you can generate Source Maps by setting **"sourceMap": {"scripts": true}** (or for older version of angularCli **"sourceMap": true**) in your angular.json
- timestampFormat {'short' | 'medium' | 'long' | 'full' | 'shortDate' | 'mediumDate' | 'longDate' | 'fullDate' | 'shortTime' | 'mediumTime' | 'longTime' | 'fullTime'}: format for the timestamp displayed with each log message. Can be any of the classic formatting options from the Angular [DatePipe](https://angular.io/api/common/DatePipe#pre-defined-format-options).

- Note: In order for the enableSourceMaps flag to work, your app must generate the source maps during the build process. If your using AngularCli you can generate Source Maps by setting **"sourceMap": {"scripts": true}** (or for older version of angularCli **"sourceMap": true**) in your angular.json
- timestampFormat {string}: format for the timestamp displayed with each log message. Can be any of the formatting options accepted by the classic Angular [DatePipe](https://angular.io/api/common/DatePipe#pre-defined-format-options).

NgxLoggerLevels: `TRACE|DEBUG|INFO|LOG|WARN|ERROR|FATAL|OFF`

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-logger",
"version": "4.1.4",
"version": "4.1.5",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down Expand Up @@ -32,7 +32,8 @@
"yildiraymeric",
"th3n3wguy <[email protected]>",
"bniedermeyer",
"jbarrett732"
"jbarrett732",
"qortex"
],
"keywords": [
"angular",
Expand Down
6 changes: 2 additions & 4 deletions src/lib/logger.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export class LoggerConfig {
disableConsoleLogging?: boolean;
httpResponseType?: 'arraybuffer' | 'blob' | 'text' | 'json';
enableSourceMaps?: boolean;
/** Timestamp format. Defaults to ISOString */
timestampFormat?: 'short' | 'medium' | 'long' | 'full' | 'shortDate' |
'mediumDate' | 'longDate' | 'fullDate' | 'shortTime' | 'mediumTime' |
'longTime' | 'fullTime' ;
/** Timestamp format: any format accepted by Angular DatePipe. Defaults to ISOString */
timestampFormat?: string;
}

0 comments on commit f4f0c9c

Please sign in to comment.