Skip to content

Latest commit

 

History

History
92 lines (57 loc) · 2.32 KB

File metadata and controls

92 lines (57 loc) · 2.32 KB

@norviah/logger / Exports / Options

Interface: Options

Table of contents

Properties

Properties

both

Optional both: boolean

If write is set, all logs are saved into a text file under dir. Within LoggingOptions, it's possible to save specific logs further in a subdirectory within the root directory dir. Also available within LoggingOptions, when logs are saved under a subdirectory, both can be used to save a log into both the specified subdirectory and the root directory.

Defined in

types/Options.ts:30


colors

Optional colors: ColorOptions

If desired, you can set the color for different aspects of a log. Logger uses chalk to generate colors, thus valid colors are the colors that chalk supports.

Defined in

types/Options.ts:47


dir

Optional dir: string

If write is true, this property determines the directory to save logs into. Defaults to logs/ within the project's root directory.

Defined in

types/Options.ts:20


format

Optional format: Format

A log has three different sections,

  • the date,
  • the title,
  • and the actual contents to print. Through format, you can customize the generated format for a log, all logs are executed trough the desired format.

Defined in

types/Options.ts:40


write

Optional write: boolean

By default, Logger only prints contents into the console, the write method does serve the purpose to save logs into a file, however it must be purposely called.

If desired, write can be set to true to save all logs into a file. Whenever the Logger.print method is called, either direct or indrect, the outputted log is saved into a text file.

Defined in

types/Options.ts:14