Comparing version 0.5.7 to 0.5.8
@@ -13,3 +13,3 @@ "use strict"; | ||
/** @deprecated */ | ||
function LoggerBrowserClassicHandler(level = log_1.LogLevel.debug, opt = { | ||
function LoggerBrowserClassicHandler(level = log_1.LogLevel.all, opt = { | ||
colors: true, | ||
@@ -16,0 +16,0 @@ levelHelper: false, |
@@ -17,3 +17,3 @@ "use strict"; | ||
function LoggerBrowserHandler(opt = {}) { | ||
const { level = log_1.LogLevel.debug, colors = true, levelHelper = false, nameBrackets = true, padding = 16, } = opt; | ||
const { level = log_1.LogLevel.all, colors = true, levelHelper = false, nameBrackets = true, padding = 16, } = opt; | ||
const matches = log_filter_js_1.useNamespaceFilter(localStorage.debug); | ||
@@ -20,0 +20,0 @@ return (msg) => { |
@@ -14,3 +14,3 @@ "use strict"; | ||
function LoggerConsoleHandler(opt = {}) { | ||
const { level = log_js_1.LogLevel.debug, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
const { level = log_js_1.LogLevel.all, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
return (msg) => { | ||
@@ -17,0 +17,0 @@ if (msg.level < level) |
export declare enum LogLevel { | ||
all = -1, | ||
debug = 0, | ||
@@ -20,2 +21,3 @@ info = 1, | ||
(...messages: any[]): void; | ||
/** @deprecated use .level = LogLevel.off or LogLevel.all */ | ||
active: boolean; | ||
@@ -22,0 +24,0 @@ level: LogLevel; |
@@ -11,2 +11,3 @@ "use strict"; | ||
(function (LogLevel) { | ||
LogLevel[LogLevel["all"] = -1] = "all"; | ||
LogLevel[LogLevel["debug"] = 0] = "debug"; | ||
@@ -49,3 +50,3 @@ LogLevel[LogLevel["info"] = 1] = "info"; | ||
log.active = true; | ||
log.level = LogLevel.debug; | ||
log.level = LogLevel.all; | ||
log.debug = function (...messages) { | ||
@@ -140,5 +141,5 @@ emit({ | ||
}; | ||
Logger.level = LogLevel.debug; | ||
Logger.level = LogLevel.all; | ||
/** @deprecated */ | ||
Logger.setLogLevel = function (level = 0) { | ||
Logger.setLogLevel = function (level = LogLevel.all) { | ||
if (logLock) | ||
@@ -145,0 +146,0 @@ return; |
@@ -10,2 +10,3 @@ "use strict"; | ||
const log = log_js_1.Logger("zeed:mq"); | ||
log.level = log_js_1.LogLevel.off; | ||
function now() { | ||
@@ -12,0 +13,0 @@ return new Date().getTime(); |
@@ -13,3 +13,3 @@ import { LogLevel } from "../common/log.js"; | ||
name?: string; | ||
debug?: boolean | LogLevel; | ||
logLevel?: LogLevel; | ||
}); | ||
@@ -16,0 +16,0 @@ private performNext; |
@@ -15,8 +15,6 @@ "use strict"; | ||
this.waitToFinish = []; | ||
const { name = uuid_js_1.uname("queue"), debug = false } = opt; | ||
const { name = uuid_js_1.uname("queue"), logLevel } = opt; | ||
this.name = name; | ||
this.log = log_js_1.Logger(`zeed:queue:${name}`); | ||
const logLevel = debug === true ? log_js_1.LogLevel.debug : +debug; | ||
this.log.active = logLevel >= log_js_1.LogLevel.debug; | ||
this.log.level = logLevel; | ||
this.log.level = logLevel !== null && logLevel !== void 0 ? logLevel : log_js_1.LogLevel.off; | ||
} | ||
@@ -23,0 +21,0 @@ async performNext() { |
/// <reference types="node" /> | ||
declare type csvOptions = { | ||
/** @deprecated will probably be replaced by logLevel */ | ||
debug?: boolean; | ||
@@ -4,0 +5,0 @@ path?: string; |
@@ -65,3 +65,4 @@ "use strict"; | ||
const debug = (options === null || options === void 0 ? void 0 : options.debug) || false; | ||
log.active = debug; | ||
if (debug !== true) | ||
log.level = log_js_1.LogLevel.off; | ||
try { | ||
@@ -68,0 +69,0 @@ // specifying an encoding returns a string instead of a buffer |
@@ -11,3 +11,3 @@ "use strict"; | ||
function LoggerFileHandler(path, opt = {}) { | ||
const { level = log_js_1.LogLevel.debug, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
const { level = log_js_1.LogLevel.all, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
path = path_1.resolve(process.cwd(), path); | ||
@@ -14,0 +14,0 @@ fs_1.mkdirSync(path_1.dirname(path), { recursive: true }); |
@@ -27,3 +27,3 @@ "use strict"; | ||
var _a; | ||
const { level = log_js_1.LogLevel.debug, colors = true, levelHelper = true, nameBrackets = true, padding = 0, filter = undefined, } = opt; | ||
const { level = log_js_1.LogLevel.all, colors = true, levelHelper = true, nameBrackets = true, padding = 0, filter = undefined, } = opt; | ||
const matches = log_filter_js_1.useNamespaceFilter((_a = filter !== null && filter !== void 0 ? filter : process.env.ZEED) !== null && _a !== void 0 ? _a : process.env.DEBUG); | ||
@@ -30,0 +30,0 @@ return (msg) => { |
@@ -10,3 +10,3 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
/** @deprecated */ | ||
export function LoggerBrowserClassicHandler(level = LogLevel.debug, opt = { | ||
export function LoggerBrowserClassicHandler(level = LogLevel.all, opt = { | ||
colors: true, | ||
@@ -13,0 +13,0 @@ levelHelper: false, |
@@ -14,3 +14,3 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
export function LoggerBrowserHandler(opt = {}) { | ||
const { level = LogLevel.debug, colors = true, levelHelper = false, nameBrackets = true, padding = 16, } = opt; | ||
const { level = LogLevel.all, colors = true, levelHelper = false, nameBrackets = true, padding = 16, } = opt; | ||
const matches = useNamespaceFilter(localStorage.debug); | ||
@@ -17,0 +17,0 @@ return (msg) => { |
@@ -11,3 +11,3 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
export function LoggerConsoleHandler(opt = {}) { | ||
const { level = LogLevel.debug, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
const { level = LogLevel.all, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
return (msg) => { | ||
@@ -14,0 +14,0 @@ if (msg.level < level) |
export declare enum LogLevel { | ||
all = -1, | ||
debug = 0, | ||
@@ -20,2 +21,3 @@ info = 1, | ||
(...messages: any[]): void; | ||
/** @deprecated use .level = LogLevel.off or LogLevel.all */ | ||
active: boolean; | ||
@@ -22,0 +24,0 @@ level: LogLevel; |
@@ -8,2 +8,3 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
(function (LogLevel) { | ||
LogLevel[LogLevel["all"] = -1] = "all"; | ||
LogLevel[LogLevel["debug"] = 0] = "debug"; | ||
@@ -46,3 +47,3 @@ LogLevel[LogLevel["info"] = 1] = "info"; | ||
log.active = true; | ||
log.level = LogLevel.debug; | ||
log.level = LogLevel.all; | ||
log.debug = function (...messages) { | ||
@@ -137,5 +138,5 @@ emit({ | ||
}; | ||
Logger.level = LogLevel.debug; | ||
Logger.level = LogLevel.all; | ||
/** @deprecated */ | ||
Logger.setLogLevel = function (level = 0) { | ||
Logger.setLogLevel = function (level = LogLevel.all) { | ||
if (logLock) | ||
@@ -142,0 +143,0 @@ return; |
// (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
// Inspired by https://github.com/diamondio/better-queue | ||
import { Logger } from "./log.js"; | ||
import { Logger, LogLevel } from "./log.js"; | ||
import { uuid } from "./uuid.js"; | ||
const log = Logger("zeed:mq"); | ||
log.level = LogLevel.off; | ||
export function now() { | ||
@@ -7,0 +8,0 @@ return new Date().getTime(); |
@@ -13,3 +13,3 @@ import { LogLevel } from "../common/log.js"; | ||
name?: string; | ||
debug?: boolean | LogLevel; | ||
logLevel?: LogLevel; | ||
}); | ||
@@ -16,0 +16,0 @@ private performNext; |
@@ -12,8 +12,6 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
this.waitToFinish = []; | ||
const { name = uname("queue"), debug = false } = opt; | ||
const { name = uname("queue"), logLevel } = opt; | ||
this.name = name; | ||
this.log = Logger(`zeed:queue:${name}`); | ||
const logLevel = debug === true ? LogLevel.debug : +debug; | ||
this.log.active = logLevel >= LogLevel.debug; | ||
this.log.level = logLevel; | ||
this.log.level = logLevel ?? LogLevel.off; | ||
} | ||
@@ -20,0 +18,0 @@ async performNext() { |
/// <reference types="node" /> | ||
declare type csvOptions = { | ||
/** @deprecated will probably be replaced by logLevel */ | ||
debug?: boolean; | ||
@@ -4,0 +5,0 @@ path?: string; |
// (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
// Adopted from https://github.com/motdotla/dotenv BSD-2 | ||
import { Logger } from "../common/log.js"; | ||
import { Logger, LogLevel } from "../common/log.js"; | ||
import fs from "fs"; | ||
@@ -59,3 +59,4 @@ import path from "path"; | ||
const debug = options?.debug || false; | ||
log.active = debug; | ||
if (debug !== true) | ||
log.level = LogLevel.off; | ||
try { | ||
@@ -62,0 +63,0 @@ // specifying an encoding returns a string instead of a buffer |
@@ -8,3 +8,3 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
export function LoggerFileHandler(path, opt = {}) { | ||
const { level = LogLevel.debug, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
const { level = LogLevel.all, colors = true, levelHelper = false, nameBrackets = true, padding = 16, filter = undefined, } = opt; | ||
path = resolve(process.cwd(), path); | ||
@@ -11,0 +11,0 @@ mkdirSync(dirname(path), { recursive: true }); |
@@ -22,3 +22,3 @@ // (C)opyright 2021-07-15 Dirk Holtwick, holtwick.it. All rights reserved. | ||
export function LoggerNodeHandler(opt = {}) { | ||
const { level = LogLevel.debug, colors = true, levelHelper = true, nameBrackets = true, padding = 0, filter = undefined, } = opt; | ||
const { level = LogLevel.all, colors = true, levelHelper = true, nameBrackets = true, padding = 0, filter = undefined, } = opt; | ||
const matches = useNamespaceFilter(filter ?? process.env.ZEED ?? process.env.DEBUG); | ||
@@ -25,0 +25,0 @@ return (msg) => { |
{ | ||
"name": "zeed", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "🌱 Simple foundation library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -19,2 +19,7 @@ # 🌱 Zeed Library | ||
Related projects: | ||
- [zeed-dom](github.com/holtwick/zeed-dom) | ||
- [zerva](github.com/holtwick/zerva) | ||
## Logging | ||
@@ -21,0 +26,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
474054
7472
188