Skip to content

Latest commit

 

History

History
55 lines (28 loc) · 1.8 KB

SPEC.md

File metadata and controls

55 lines (28 loc) · 1.8 KB

Specification for the format of internal messages of mag logger

Version: 1.0

Internal log message

Each internal log message is a plain JavaScript Object.

The message must contain fields described below and can include any additional fields. Names of additional fields must not conflict with required fields and standard built-in methods and properties of Object.

Required fields

timestamp - Date

The time when the log messages were called.

arguments - Array

An array of original items for logging.

severity - Number

The severity level of the message. According to the specification: Syslog Message Severities

namespace - String

An arbitrary string identifier. Can be empty.

Additional fields

You can add custom fields to the log object according to your needs. Below are recommendations for the field names and their types.

message - String

Fully formatted string representing the log message. For example, it can be produced from arguments and timestamp.

pid

The PID of the process.

hostname

Arbitrary machine name as a string.

platform

Machine platform.

arch

Processor architecture.

cwd

Current working directory of the process.