Skip to content

Version/2.3.0 #46

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 11 commits into from
Dec 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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