Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Feature/update api #4

Merged
merged 10 commits into from
Sep 28, 2017
Merged

Feature/update api #4

merged 10 commits into from
Sep 28, 2017

Conversation

heikomat
Copy link
Contributor

@heikomat heikomat commented Sep 25, 2017

Please read this for context

This includes the small changes of #3

This removes winston, as it is not needeed anymore. instead, everything gets logged, no matter the loglevel. The loglevel is just for the prefix in the log, and the prefixes color.

This removes the loglevels critical, debug and silly. It also adds some benchmarks for anyone who wants to benchmark the aspects of loggerhythm. On my machine, i get up to 180k logs/sec for simple logs, and up to 17k logs/sec when logging circular and complex objects.

Please discuss if colored loglevels and colored object-logs should be enabled or disabled by default, and if they should be configurable. currently,colors are enabled by default and not configurable

regarding log-colors, see #5

Copy link
Member

@moellenbeck moellenbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum sind die benchmarks eingecheckt. Sind diese bei der NPM Veröffentlichung.

}

export interface ILogFunction {
(message: string, ...parameter: Array<any>): void;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sollte parameters oder arguments heißen (Plural)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ich werde es wie überall sonst auch logObjects nennen

}

export interface ILoggerhythmHook {
(logLevel: LogLevel, namespace: string, message: string, ...parameter: Array<any>): void;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sollte parameters oder arguments heißen (Plural)

} else {
(<any> winston).level = LogLevel.DEBUG;
}
const stdoutIsAvaliable: boolean = process !== undefined &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

betrifft eigentlich auch den stderr stream - name irreführend :P

}

public warn(message: string, ...logParameter: Array<any>): void {
this._log(LogLevel.WARN, message, ...logParameter);
public createLogger(namespace?: string): Logger {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bin etwas verwirrt, wozu diese Methode dient - wäre es nicht sinnvoll eine statische Variante zum Erzeugen neuer Logger zu haben und eine instanzgebundene Variante, die einen Child-Logger erstellt, der sich an den Namespace seines Parent anhängt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guter Einfall! werde die isntanz-Methode umbenennen, zu createChildLogger, so dass der namespace concatiniert wird

@heikomat
Copy link
Contributor Author

@moellenbeck die benchmarks sind nicht in den files in der package.json gelistet, landen also beim npm publish nicht mit im Paket

@heikomat heikomat merged commit fc3abfd into develop Sep 28, 2017
@heikomat heikomat deleted the feature/update_api branch September 28, 2017 12:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants