I just started learning LoopBack and its concept. I just spent a few hours getting the logging extension up and running and found two things that could be improved.
I think it would be very helpful, if you could add the LogSequence class to the README Example Usage part. For me (as a beginner) it wasn't 100% clear how I had to adjust my MySequence class.
And the second thing is that the following call didn't worked for me.
exportclassServerApplicationextendsLogLevelMixin(Application){constructor(options?: ApplicationConfig){options=Object.assign({},{components: [RestComponent,LogComponent],// didn't worked until I added the else if in LogLevelMixin.**logLevel: LOG_LEVEL.DEBUG**},options);super(options);// alternatively, I could set it directly.// ** this.logLevel(LOG_LEVEL.DEBUG); **this.server(RestServer);this.setupControllers();}[...]}exportfunctionLogLevelMixin<TextendsConstructor<any>>(superClass: T){returnclassextendssuperClass{// A mixin class has to take in a type any[] argument!// tslint:disable-next-line:no-anyconstructor(...args: any[]){super(...args);if(!this.options)this.options={};if(this.options.logLevel){this.logLevel(this.options.logLevel);}elseif(args&&args.length>0&&"undefined"!==typeof(args[0].logLevel)){**this.logLevel(args[0].logLevel);**}}[...]}
Thank you very much for the example, gave me a very good insight into the topic! ๐