How to use the @awesomeeng/awesome-log.warn function in @awesomeeng/awesome-log

To help you get started, we’ve selected a few @awesomeeng/awesome-log examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awesomeeng / awesome-server / src / http2 / PushResponse.js View on Github external
this.stream.stream.on("error",()=>{
			// this event handler must be here or node will die when the error gets swallowed by http2.
			// See https://github.com/nodejs/node/issues/22323
			Log.warn("The client refushed the push stream for "+this.headers[":path"]+".");
		});
	}
github awesomeeng / zephjs / src / cli / commands / Serve.js View on Github external
let path,route;
				if (arg==="." || arg==="/" || arg==="./") {
					path = cwd;
					route = "/*";
				}
				else {
					path = Path.resolve(cwd,arg);
					route = ("/"+path.slice(cwd.length+1)).replace(/\/\.\//,"/");
				}

				if (path && route && AwesomeUtils.FS.existsSync(path)) {
					server.serve(route,path);
					Log.info("Serving "+route+" from "+path);
				}
				else {
					Log.warn("Path "+arg+" did not resolve to a valid file or directory; skipping.");
					return;
				}
			});
		}
github awesomeeng / awesome-server / src / controllers / DirectoryServeController.js View on Github external
return new Promise(async (resolve,reject)=>{
			try {
				if (!path || path==="/") path = "index.html";
				let filename = Path.resolve(this.dir,path);

				let stat = await AwesomeUtils.FS.stat(filename);
				if (!stat) {
					Log.warn("File not found: "+path);
					response.writeError(404,"File not found: "+path);
					return resolve();
				}
				if (stat && stat.isDirectory()) {
					filename = Path.resolve(path,"./index.html");
					let dirstat = await AwesomeUtils.FS.stat(filename);
					if (!dirstat) {
						Log.warn("File not found: "+path);
						response.writeError(404,"File not found: "+path);
						return resolve();
					}
				}

				let contentType = AwesomeUtils.MimeTypes.getTypeForExtension(filename,"application/octet-stream");

				await response.serve(200,contentType,filename);
github awesomeeng / awesome-server / src / AwesomeServer.js View on Github external
async start() {
		if (this.running) return Promise.resolve();

		if (this.config.informative) Log.info("Starting...");

		if (this[$SERVERS].size<1) {
			Log.warn("No servers defined. Nothing to do.");
		}
		else {
			await Promise.all([...this[$SERVERS]].map((server)=>{
				let prom = server.start(this.handler.bind(this));
				if (prom instanceof Promise) return prom;
				return Promise.resolve();
			}));
		}

		this[$RUNNING] = true;

		if (this.config.informative) Log.info("Started.");
	}

@awesomeeng/awesome-log

AwesomeLog is a Log System for enterprise nodejs applications. It provides a basic out of the box logging solution that is ready to go with zero configuration but also gives you a highly configurable logging solution that with the power to do your logging

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis