@vechain/sdk-logging
Advanced tools
Comparing version 1.0.0-beta.32 to 1.0.0-rc.1
@@ -1,92 +0,21 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
'use strict'; | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
VeChainSDKLogger: () => VeChainSDKLogger, | ||
logging: () => logging_exports | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/logging.ts | ||
var logging_exports = {}; | ||
__export(logging_exports, { | ||
VeChainSDKLogger: () => VeChainSDKLogger | ||
}); | ||
// src/logger/log-logger/log-logger.ts | ||
var _logLogFunction = { | ||
log: (data) => { | ||
const messagesAsString = data.messages.map((message) => `- ${message}`).join("\n"); | ||
console.log( | ||
` | ||
****************** EVENT: ${data.title} ****************** | ||
` + messagesAsString + ` | ||
` | ||
); | ||
} | ||
}; | ||
// src/logger/error-logger/error-logger.ts | ||
var _logErrorFunction = { | ||
log: (error) => { | ||
console.error( | ||
` | ||
****************** ERROR ON: ${error.methodName} ****************** | ||
- Error message: '${error.errorMessage}' | ||
var i=Object.defineProperty;var s=(o,r)=>{for(var e in r)i(o,e,{get:r[e],enumerable:!0});};var p={};s(p,{VeChainSDKLogger:()=>m});var n={log:o=>{let r=o.messages.map(e=>`- ${e}`).join(` | ||
`);console.log(` | ||
****************** EVENT: ${o.title} ****************** | ||
`+r+` | ||
`);}};var t={log:o=>{console.error(` | ||
****************** ERROR ON: %s ****************** | ||
- Error message: '%s' | ||
- Error data: | ||
`, | ||
error.data, | ||
` | ||
%o | ||
- Internal error: | ||
`, | ||
error.innerError, | ||
` | ||
` | ||
); | ||
} | ||
}; | ||
%o | ||
`,o.methodName,o.errorMessage,o.data,o.innerError);}};var g={log:o=>{let r=o.messages.map(e=>`- ${e}`).join(` | ||
`);console.warn(` | ||
****************** WARNING: ${o.title} ****************** | ||
`+r+` | ||
`);}};var m=o=>o==="error"?t:o==="warning"?g:n; | ||
// src/logger/warning-logger/warning-logger.ts | ||
var _logWarningFunction = { | ||
log: (data) => { | ||
const messagesAsString = data.messages.map((message) => `- ${message}`).join("\n"); | ||
console.warn( | ||
` | ||
****************** WARNING: ${data.title} ****************** | ||
` + messagesAsString + ` | ||
` | ||
); | ||
} | ||
}; | ||
// src/logger/vechainSDKLogger.ts | ||
var VeChainSDKLogger = (loggerType) => { | ||
if (loggerType === "error") | ||
return _logErrorFunction; | ||
if (loggerType === "warning") | ||
return _logWarningFunction; | ||
return _logLogFunction; | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
VeChainSDKLogger, | ||
logging | ||
}); | ||
exports.VeChainSDKLogger = m; | ||
exports.logging = p; |
{ | ||
"name": "@vechain/sdk-logging", | ||
"version": "1.0.0-beta.32", | ||
"version": "1.0.0-rc.1", | ||
"description": "This module provides functionality to logging data for vechain-sdk", | ||
@@ -37,4 +37,4 @@ "author": "VeChain Foundation", | ||
"dependencies": { | ||
"@vechain/sdk-errors": "1.0.0-beta.32" | ||
"@vechain/sdk-errors": "1.0.0-rc.1" | ||
} | ||
} |
@@ -10,9 +10,10 @@ import type { LogFunctionType } from '../types'; | ||
console.error( | ||
`\n****************** ERROR ON: ${error.methodName} ******************\n` + | ||
`- Error message: '${error.errorMessage}'` + | ||
'\n- Error data:\n', | ||
`\n****************** ERROR ON: %s ******************\n` + | ||
`- Error message: '%s'` + | ||
'\n- Error data:\n%o' + | ||
`\n- Internal error:\n%o\n`, | ||
error.methodName, | ||
error.errorMessage, | ||
error.data, | ||
`\n- Internal error:\n`, | ||
error.innerError, | ||
`\n` | ||
error.innerError | ||
); | ||
@@ -19,0 +20,0 @@ } |
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
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
14906
256
1
1
+ Added@vechain/sdk-errors@1.0.0-rc.1(transitive)
- Removed@vechain/sdk-errors@1.0.0-beta.32(transitive)