Skip to content

Commit

Permalink
Version/2.3.0 (#46)
Browse files Browse the repository at this point in the history
* Add build script

* Update package dependencies versions

* Fix string builder configuration (#44)

* Add default

* Add test code

* fix makeDateFormat expect test case

* Add banner

* Fix banner size

* Set global config with default config

* Update version

* Update version

Co-authored-by: Roman Kinyakin <1@grep.su>
  • Loading branch information
hg-pyun and Roman Kinyakin authored Dec 31, 2019
1 parent 86c273e commit ad1b66a
Show file tree
Hide file tree
Showing 17 changed files with 1,437 additions and 1,357 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

> Beautify Axios Logging Messages.
![logo](https://user-images.githubusercontent.com/10627668/71610488-dbdd5c80-2bd4-11ea-8a8a-15c0328bba0b.png)

When you send a request in nodejs, you need to show the log to the console.
This library display the necessary information while communicating with the server.

Expand Down Expand Up @@ -114,6 +116,10 @@ instance.interceptors.request.use((request) => {

#### Enable config list

- url: boolean (default true)
- method: boolean (default true)
- data: boolean (default true)
- status: boolean (default true)
- prefixText: string | false (default Axios)
- dateFormat: [dateformat](https://github.com/felixge/node-dateformat) | false (default isoDateTime)
- header: boolean (default false)
Expand Down
4 changes: 2 additions & 2 deletions lib/common/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ErrorLogConfig, GlobalLogConfig, RequestLogConfig, ResponseLogConfig } from './types';
declare function getGlobalConfig(): GlobalLogConfig;
declare function setGlobalConfig(config: GlobalLogConfig): void;
declare function mergeWithGlobalConfig(config?: RequestLogConfig | ResponseLogConfig | ErrorLogConfig): {
declare function assembleBuildConfig(config?: RequestLogConfig | ResponseLogConfig | ErrorLogConfig): {
data?: boolean | undefined;
url?: boolean | undefined;
method?: boolean | undefined;
Expand Down Expand Up @@ -42,4 +42,4 @@ declare function mergeWithGlobalConfig(config?: RequestLogConfig | ResponseLogCo
status?: boolean | undefined;
statusText?: boolean | undefined;
};
export { getGlobalConfig, setGlobalConfig, mergeWithGlobalConfig, };
export { getGlobalConfig, setGlobalConfig, assembleBuildConfig, };
50 changes: 34 additions & 16 deletions lib/common/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/common/string-builder.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ declare class StringBuilder {
private printQueue;
private filteredHeaderList;
constructor(config: GlobalLogConfig);
makePrefix(logType: string | false): this;
makeDateFormat(): this;
makeLogTypeWithPrefix(logType: string): this;
makeDateFormat(date: Date): this;
makeHeader(headers?: {
[key: string]: {
value: string;
Expand Down
Loading

0 comments on commit ad1b66a

Please sign in to comment.