@teambit/logger 0.0.980 → 0.0.982

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <testsuites tests="0" failures="0" errors="0" skipped="0">
3
- <testsuite name="teambit.harmony/logger@0.0.980" tests="0" failures="0" errors="0" skipped="0"/>
3
+ <testsuite name="teambit.harmony/logger@0.0.982" tests="0" failures="0" errors="0" skipped="0"/>
4
4
  </testsuites>
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/logger-preview"]=t():e["teambit.harmony/logger-preview"]=t()}(self,(()=>(()=>{"use strict";var e={25309:(e,t,n)=>{Object.defineProperty(t,"V",{enumerable:!0,get:function(){return o.default}});var o=r(n(8468));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.harmony/aspect-docs/logger@0.0.168",homepage:"https://bit.cloud/teambit/harmony/aspect-docs/logger",exported:!0}},8468:(e,t,n)=>{var o={id:"teambit.harmony/aspect-docs/logger@0.0.168",homepage:"https://bit.cloud/teambit/harmony/aspect-docs/logger",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,s(n(41594));var r=n(5016),a=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(null,arguments)}function l(e,t){if(null==e)return{};var n,o,r=m(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}s.__bit_component=o,i.__bit_component=o,l.__bit_component=o,m.__bit_component=o;var d={},p="wrapper";function c(e){var t=e.components,n=l(e,a);return(0,r.mdx)(p,i({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("h2",null,"Create a logger"),(0,r.mdx)("p",null,"In your extension, add ",(0,r.mdx)("inlineCode",{parentName:"p"},"LoggerMain")," as a dependency and create a new logger by running"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"LoggerMain.createLogger('your-extension-id');\n")),(0,r.mdx)("h2",null,"Log to a file"),(0,r.mdx)("p",null,"The following standard methods are available to log into a file. By default it's the ",(0,r.mdx)("inlineCode",{parentName:"p"},"debug.log")," file located at ",(0,r.mdx)("inlineCode",{parentName:"p"},"~/Library/Caches/Bit/logs")," for Mac/Linux or ",(0,r.mdx)("inlineCode",{parentName:"p"},"%LOCALAPPDATA%\\Bit")," for Windows."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"logger.trace(message: string, ...meta: any[]);\nlogger.debug(message: string, ...meta: any[]);\nlogger.info(message: string, ...meta: any[]);\nlogger.warn(message: string, ...meta: any[]);\nlogger.error(message: string, ...meta: any[]);\n")),(0,r.mdx)("p",null,"The message color is coded uniquely per extension-id. This way, it's easier to scroll the logs and distinguish between the extensions."),(0,r.mdx)("p",null,"The format of the message logged to the file is ",(0,r.mdx)("strong",{parentName:"p"},'"TIMESTAMP LEVEL: EXT-ID, MSG ',"[META]",'"'),'. The "',"[META]",'" part is ',(0,r.mdx)("inlineCode",{parentName:"p"},"JSON.stringify")," of the second parameter in case it's an object. Otherwise, it's ignored."),(0,r.mdx)("p",null,"JSON format is available as well. To use it, run ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit config set log_json_format true"),"."),(0,r.mdx)("p",null,"It's possible to have the console as an extra layer so these messages will be printed to the screen as well, see below."),(0,r.mdx)("h3",null,"Log stack trace"),(0,r.mdx)("p",null,"Normally, there is no need to log the Error object because it being caught by the end of the process and gets logged by Bit. Sometimes though it is needed to locally catch the error and continue, which can be useful to log the entire error object include the stack trace. In which case, pass the error object as the second parameter. e.g. ",(0,r.mdx)("inlineCode",{parentName:"p"},"catch(err) { logger.error('got an error during component-load', err); }")),(0,r.mdx)("h3",null,"Log also to the console"),(0,r.mdx)("p",null,"To see the same massages above printed into the screen, use the global flag ",(0,r.mdx)("inlineCode",{parentName:"p"},"--log [level]"),". For example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit status --log=error"),". If the level was not entered, it defaults to ",(0,r.mdx)("inlineCode",{parentName:"p"},"info"),"."),(0,r.mdx)("p",null,"Alternatively, you can set an environment variable ",(0,r.mdx)("inlineCode",{parentName:"p"},"BIT_LOG")," with the desired level."),(0,r.mdx)("p",null,"The format of the message logged to the console is ",(0,r.mdx)("strong",{parentName:"p"},'"MSG ',"[META]",'"'),' The "',"[META]",'" part is the same as above.'),(0,r.mdx)("h2",null,"Report progress"),(0,r.mdx)("p",null,"During the command execution it's helpful to see the progress on the screen. The following options log to the file and in addition, print to the screen. Use only these methods and avoid calling ",(0,r.mdx)("inlineCode",{parentName:"p"},"console.log")," to not break the output (or potentially the JSON structure)."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},'Please note that these methods print to the screen only when a command is not considered "internal" (such commands normally run on the remote server) and when a command is not used with ',(0,r.mdx)("inlineCode",{parentName:"p"},"--json")," flag. To specifically disable console-printing to a command, set the ",(0,r.mdx)("inlineCode",{parentName:"p"},"loader")," property to ",(0,r.mdx)("inlineCode",{parentName:"p"},"false"),".")),(0,r.mdx)("h3",null,"Status Line (spinner)"),(0,r.mdx)("p",null,"The status-line is a single line on the bottom of the screen, with a spinner/loader prefix. It's changing constantly during the command execution. This is the main indicator for the end-user of what's going on at the moment."),(0,r.mdx)("p",null,"To set the text of this status-line, call:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-js"},"logger.setStatusLine((text: string));\n")),(0,r.mdx)("p",null,"Once the command completed, the spinner is stopped and the status-line is cleared. Then, the command results are printed. If, for some reason, it is needed to clear the status-line before, just call ",(0,r.mdx)("inlineCode",{parentName:"p"},"logger.clearStatusLine()"),"."),(0,r.mdx)("h3",null,"Persist text"),(0,r.mdx)("p",null,"Sometimes it's helpful to indicate that a phase has completed. Either successfully or failed. The following methods help with this:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-js"},"// print to the screen with a green `✔` prefix. if message is empty, print the last logged message.\nlogger.consoleSuccess(message?: string);\n\n// print to the screen with a red `✖` prefix. if message is empty, print the last logged message.\nlogger.consoleFailure(message?: string);\n")),(0,r.mdx)("p",null,"To print without any prefix, use ",(0,r.mdx)("inlineCode",{parentName:"p"},"logger.console(message);")),(0,r.mdx)("h3",null,"Long Running Process Logger"),(0,r.mdx)("p",null,"Run the following to get an instance of the ",(0,r.mdx)("inlineCode",{parentName:"p"},"LongProcessLogger")," and start logging the process description."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-js"},"logger.createLongProcessLogger(processDescription: string, totalItems?: number): LongProcessLogger;\n")),(0,r.mdx)("p",null,"If the process involves iteration over a list of items, such as running tag on a list of components, then pass the ",(0,r.mdx)("inlineCode",{parentName:"p"},"totalItems")," as the total number of the components in the list."),(0,r.mdx)("p",null,"Later, during the iteration, call ",(0,r.mdx)("inlineCode",{parentName:"p"},"logProgress(componentName)")," on the ",(0,r.mdx)("inlineCode",{parentName:"p"},"LongProcessLogger")," instance.\nonce done, call ",(0,r.mdx)("inlineCode",{parentName:"p"},"end()"),", which logs the duration of the process in ms."),(0,r.mdx)("p",null,"Here is an example of the messages produced by this longProcessLogger. The status-line always shows the last message."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"teambit.workspace/workspace, loading components (total: 20)\nteambit.workspace/workspace, loading components (1/20). ui/button\nteambit.workspace/workspace, loading components (2/20). ui/form\n...\nteambit.workspace/workspace, loading components (20/20). ui/page\nteambit.workspace/workspace, loading components (completed in 200ms)\n")),(0,r.mdx)("p",null,"An example when there is no ",(0,r.mdx)("inlineCode",{parentName:"p"},"totalItems"),"."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"teambit.workspace/workspace, loading components\nteambit.workspace/workspace, loading components (completed in 200ms)\n")))}c.__bit_component=o,c.isMDXComponent=!0},9438:(e,t,n)=>{var o={id:"teambit.harmony/logger@0.0.980",homepage:"https://bit.cloud/teambit/harmony/logger",exported:!0};function r(){const e=a(n(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,a.__bit_component=o;const s=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/logger.svg"}));s.__bit_component=o,t.Logo=s},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{compositions:()=>u,compositions_metadata:()=>f,overview:()=>h});var r={};n.r(r),n.d(r,{default:()=>g});var a=n(9438),s=(n(41594),n(5016));const i=TeambitMdxUiMdxScopeContext;var l=n(25309),m=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(null,arguments)}var p={},c="wrapper";function g(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,m);return(0,s.mdx)(c,d({},p,n,{components:t,mdxType:"MDXLayout"}),(0,s.mdx)(i.MDXScopeProvider,{components:{Logger:l.V},mdxType:"MDXScopeProvider"},(0,s.mdx)(l.V,{mdxType:"Logger"})))}g.isMDXComponent=!0;const u=[a],h=[r],f={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/logger-preview"]=t():e["teambit.harmony/logger-preview"]=t()}(self,(()=>(()=>{"use strict";var e={25309:(e,t,n)=>{Object.defineProperty(t,"V",{enumerable:!0,get:function(){return o.default}});var o=r(n(8468));function r(e){return e&&e.__esModule?e:{default:e}}r.__bit_component={id:"teambit.harmony/aspect-docs/logger@0.0.168",homepage:"https://bit.cloud/teambit/harmony/aspect-docs/logger",exported:!0}},8468:(e,t,n)=>{var o={id:"teambit.harmony/aspect-docs/logger@0.0.168",homepage:"https://bit.cloud/teambit/harmony/aspect-docs/logger",exported:!0};Object.defineProperty(t,"__esModule",{value:!0}),t.default=c,s(n(41594));var r=n(5016),a=["components"];function s(e){return e&&e.__esModule?e:{default:e}}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(null,arguments)}function l(e,t){if(null==e)return{};var n,o,r=m(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}s.__bit_component=o,i.__bit_component=o,l.__bit_component=o,m.__bit_component=o;var d={},p="wrapper";function c(e){var t=e.components,n=l(e,a);return(0,r.mdx)(p,i({},d,n,{components:t,mdxType:"MDXLayout"}),(0,r.mdx)("h2",null,"Create a logger"),(0,r.mdx)("p",null,"In your extension, add ",(0,r.mdx)("inlineCode",{parentName:"p"},"LoggerMain")," as a dependency and create a new logger by running"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre"},"LoggerMain.createLogger('your-extension-id');\n")),(0,r.mdx)("h2",null,"Log to a file"),(0,r.mdx)("p",null,"The following standard methods are available to log into a file. By default it's the ",(0,r.mdx)("inlineCode",{parentName:"p"},"debug.log")," file located at ",(0,r.mdx)("inlineCode",{parentName:"p"},"~/Library/Caches/Bit/logs")," for Mac/Linux or ",(0,r.mdx)("inlineCode",{parentName:"p"},"%LOCALAPPDATA%\\Bit")," for Windows."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-ts"},"logger.trace(message: string, ...meta: any[]);\nlogger.debug(message: string, ...meta: any[]);\nlogger.info(message: string, ...meta: any[]);\nlogger.warn(message: string, ...meta: any[]);\nlogger.error(message: string, ...meta: any[]);\n")),(0,r.mdx)("p",null,"The message color is coded uniquely per extension-id. This way, it's easier to scroll the logs and distinguish between the extensions."),(0,r.mdx)("p",null,"The format of the message logged to the file is ",(0,r.mdx)("strong",{parentName:"p"},'"TIMESTAMP LEVEL: EXT-ID, MSG ',"[META]",'"'),'. The "',"[META]",'" part is ',(0,r.mdx)("inlineCode",{parentName:"p"},"JSON.stringify")," of the second parameter in case it's an object. Otherwise, it's ignored."),(0,r.mdx)("p",null,"JSON format is available as well. To use it, run ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit config set log_json_format true"),"."),(0,r.mdx)("p",null,"It's possible to have the console as an extra layer so these messages will be printed to the screen as well, see below."),(0,r.mdx)("h3",null,"Log stack trace"),(0,r.mdx)("p",null,"Normally, there is no need to log the Error object because it being caught by the end of the process and gets logged by Bit. Sometimes though it is needed to locally catch the error and continue, which can be useful to log the entire error object include the stack trace. In which case, pass the error object as the second parameter. e.g. ",(0,r.mdx)("inlineCode",{parentName:"p"},"catch(err) { logger.error('got an error during component-load', err); }")),(0,r.mdx)("h3",null,"Log also to the console"),(0,r.mdx)("p",null,"To see the same massages above printed into the screen, use the global flag ",(0,r.mdx)("inlineCode",{parentName:"p"},"--log [level]"),". For example, ",(0,r.mdx)("inlineCode",{parentName:"p"},"bit status --log=error"),". If the level was not entered, it defaults to ",(0,r.mdx)("inlineCode",{parentName:"p"},"info"),"."),(0,r.mdx)("p",null,"Alternatively, you can set an environment variable ",(0,r.mdx)("inlineCode",{parentName:"p"},"BIT_LOG")," with the desired level."),(0,r.mdx)("p",null,"The format of the message logged to the console is ",(0,r.mdx)("strong",{parentName:"p"},'"MSG ',"[META]",'"'),' The "',"[META]",'" part is the same as above.'),(0,r.mdx)("h2",null,"Report progress"),(0,r.mdx)("p",null,"During the command execution it's helpful to see the progress on the screen. The following options log to the file and in addition, print to the screen. Use only these methods and avoid calling ",(0,r.mdx)("inlineCode",{parentName:"p"},"console.log")," to not break the output (or potentially the JSON structure)."),(0,r.mdx)("blockquote",null,(0,r.mdx)("p",{parentName:"blockquote"},'Please note that these methods print to the screen only when a command is not considered "internal" (such commands normally run on the remote server) and when a command is not used with ',(0,r.mdx)("inlineCode",{parentName:"p"},"--json")," flag. To specifically disable console-printing to a command, set the ",(0,r.mdx)("inlineCode",{parentName:"p"},"loader")," property to ",(0,r.mdx)("inlineCode",{parentName:"p"},"false"),".")),(0,r.mdx)("h3",null,"Status Line (spinner)"),(0,r.mdx)("p",null,"The status-line is a single line on the bottom of the screen, with a spinner/loader prefix. It's changing constantly during the command execution. This is the main indicator for the end-user of what's going on at the moment."),(0,r.mdx)("p",null,"To set the text of this status-line, call:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-js"},"logger.setStatusLine((text: string));\n")),(0,r.mdx)("p",null,"Once the command completed, the spinner is stopped and the status-line is cleared. Then, the command results are printed. If, for some reason, it is needed to clear the status-line before, just call ",(0,r.mdx)("inlineCode",{parentName:"p"},"logger.clearStatusLine()"),"."),(0,r.mdx)("h3",null,"Persist text"),(0,r.mdx)("p",null,"Sometimes it's helpful to indicate that a phase has completed. Either successfully or failed. The following methods help with this:"),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-js"},"// print to the screen with a green `✔` prefix. if message is empty, print the last logged message.\nlogger.consoleSuccess(message?: string);\n\n// print to the screen with a red `✖` prefix. if message is empty, print the last logged message.\nlogger.consoleFailure(message?: string);\n")),(0,r.mdx)("p",null,"To print without any prefix, use ",(0,r.mdx)("inlineCode",{parentName:"p"},"logger.console(message);")),(0,r.mdx)("h3",null,"Long Running Process Logger"),(0,r.mdx)("p",null,"Run the following to get an instance of the ",(0,r.mdx)("inlineCode",{parentName:"p"},"LongProcessLogger")," and start logging the process description."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-js"},"logger.createLongProcessLogger(processDescription: string, totalItems?: number): LongProcessLogger;\n")),(0,r.mdx)("p",null,"If the process involves iteration over a list of items, such as running tag on a list of components, then pass the ",(0,r.mdx)("inlineCode",{parentName:"p"},"totalItems")," as the total number of the components in the list."),(0,r.mdx)("p",null,"Later, during the iteration, call ",(0,r.mdx)("inlineCode",{parentName:"p"},"logProgress(componentName)")," on the ",(0,r.mdx)("inlineCode",{parentName:"p"},"LongProcessLogger")," instance.\nonce done, call ",(0,r.mdx)("inlineCode",{parentName:"p"},"end()"),", which logs the duration of the process in ms."),(0,r.mdx)("p",null,"Here is an example of the messages produced by this longProcessLogger. The status-line always shows the last message."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"teambit.workspace/workspace, loading components (total: 20)\nteambit.workspace/workspace, loading components (1/20). ui/button\nteambit.workspace/workspace, loading components (2/20). ui/form\n...\nteambit.workspace/workspace, loading components (20/20). ui/page\nteambit.workspace/workspace, loading components (completed in 200ms)\n")),(0,r.mdx)("p",null,"An example when there is no ",(0,r.mdx)("inlineCode",{parentName:"p"},"totalItems"),"."),(0,r.mdx)("pre",null,(0,r.mdx)("code",{parentName:"pre",className:"language-bash"},"teambit.workspace/workspace, loading components\nteambit.workspace/workspace, loading components (completed in 200ms)\n")))}c.__bit_component=o,c.isMDXComponent=!0},26232:(e,t,n)=>{var o={id:"teambit.harmony/logger@0.0.982",homepage:"https://bit.cloud/teambit/harmony/logger",exported:!0};function r(){const e=a(n(41594));return r=function(){return e},e}function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,r.__bit_component=o,a.__bit_component=o;const s=()=>r().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},r().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/logger.svg"}));s.__bit_component=o,t.Logo=s},5016:e=>{e.exports=MdxJsReact},41594:e=>{e.exports=React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{compositions:()=>u,compositions_metadata:()=>f,overview:()=>h});var r={};n.r(r),n.d(r,{default:()=>g});var a=n(26232),s=(n(41594),n(5016));const i=TeambitMdxUiMdxScopeContext;var l=n(25309),m=["components"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},d.apply(null,arguments)}var p={},c="wrapper";function g(e){var t=e.components,n=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,m);return(0,s.mdx)(c,d({},p,n,{components:t,mdxType:"MDXLayout"}),(0,s.mdx)(i.MDXScopeProvider,{components:{Logger:l.V},mdxType:"MDXScopeProvider"},(0,s.mdx)(l.V,{mdxType:"Logger"})))}g.isMDXComponent=!0;const u=[a],h=[r],f={compositions:[{displayName:"Logo",identifier:"Logo"}]};return o})()));
@@ -566,7 +566,8 @@
566
566
  "character": 3
567
567
  },
568
568
  "raw": "/**\n * use it for a long running process. upon creation it logs the `processDescription`.\n * if the process involves iteration over a list of items, such as running tag on a list of\n * components, then pass the `totalItems` as the total of the total components in the list.\n * later, during the iteration, call `LongProcessLogger.logProgress(componentName)`.\n * once done, call `LongProcessLogger.end()`\n * the status-line will show all messages in the terminal.\n */",
569
- "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total of the total components in the list.\nlater, during the iteration, call `LongProcessLogger.logProgress(componentName)`.\nonce done, call `LongProcessLogger.end()`\nthe status-line will show all messages in the terminal."
569
+ "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total of the total components in the list.\nlater, during the iteration, call `LongProcessLogger.logProgress(componentName)`.\nonce done, call `LongProcessLogger.end()`\nthe status-line will show all messages in the terminal.",
570
+ "tags": []
570
571
  },
571
572
  "signature": "(method) Logger.createLongProcessLogger(processDescription: string, totalItems?: number, shouldConsole?: ConsoleOnStart): LongProcessLogger",
572
573
  "name": "createLongProcessLogger",
@@ -659,7 +660,8 @@
659
660
  "character": 3
660
661
  },
661
662
  "raw": "/**\n * single status-line on the bottom of the screen.\n * the text is replaced every time this method is called.\n */",
662
- "comment": "single status-line on the bottom of the screen.\nthe text is replaced every time this method is called."
663
+ "comment": "single status-line on the bottom of the screen.\nthe text is replaced every time this method is called.",
664
+ "tags": []
663
665
  },
664
666
  "signature": "(method) Logger.setStatusLine(text: string, shouldPrintOnCI?: boolean): void",
665
667
  "name": "setStatusLine",
@@ -732,7 +734,8 @@
732
734
  "character": 3
733
735
  },
734
736
  "raw": "/**\n * remove the text from the last line on the screen.\n */",
735
- "comment": "remove the text from the last line on the screen."
737
+ "comment": "remove the text from the last line on the screen.",
738
+ "tags": []
736
739
  },
737
740
  "signature": "(method) Logger.clearStatusLine(): void",
738
741
  "name": "clearStatusLine",
@@ -763,7 +766,8 @@
763
766
  "character": 3
764
767
  },
765
768
  "raw": "/**\n * print to the screen. if message is empty, print the last logged message.\n */",
766
- "comment": "print to the screen. if message is empty, print the last logged message."
769
+ "comment": "print to the screen. if message is empty, print the last logged message.",
770
+ "tags": []
767
771
  },
768
772
  "signature": "(method) Logger.console(message?: string, ...meta: any[]): void",
769
773
  "name": "console",
@@ -843,6 +847,7 @@
843
847
  "character": 3
844
848
  },
845
849
  "raw": "/**\n * @deprecated\n * try using consoleWarning. if not possible, rename this method to a clearer one\n */",
850
+ "comment": "",
846
851
  "tags": [
847
852
  {
848
853
  "__schema": "TagSchema",
@@ -934,6 +939,7 @@
934
939
  "character": 3
935
940
  },
936
941
  "raw": "/**\n * @deprecated\n * try using consoleFailure. if not possible, rename this method to a clearer one\n */",
942
+ "comment": "",
937
943
  "tags": [
938
944
  {
939
945
  "__schema": "TagSchema",
@@ -1025,7 +1031,8 @@
1025
1031
  "character": 3
1026
1032
  },
1027
1033
  "raw": "/**\n * print to the screen as a title, with bold text.\n */",
1028
- "comment": "print to the screen as a title, with bold text."
1034
+ "comment": "print to the screen as a title, with bold text.",
1035
+ "tags": []
1029
1036
  },
1030
1037
  "signature": "(method) Logger.consoleTitle(message: string): void",
1031
1038
  "name": "consoleTitle",
@@ -1077,7 +1084,8 @@
1077
1084
  "character": 3
1078
1085
  },
1079
1086
  "raw": "/**\n * print to the screen with a green `✔` prefix. if message is empty, print the last logged message.\n */",
1080
- "comment": "print to the screen with a green `✔` prefix. if message is empty, print the last logged message."
1087
+ "comment": "print to the screen with a green `✔` prefix. if message is empty, print the last logged message.",
1088
+ "tags": []
1081
1089
  },
1082
1090
  "signature": "(method) Logger.consoleSuccess(message?: string, startTime?: [number, number]): void",
1083
1091
  "name": "consoleSuccess",
@@ -1168,7 +1176,8 @@
1168
1176
  "character": 3
1169
1177
  },
1170
1178
  "raw": "/**\n * turn off the logger.\n */",
1171
- "comment": "turn off the logger."
1179
+ "comment": "turn off the logger.",
1180
+ "tags": []
1172
1181
  },
1173
1182
  "signature": "(method) Logger.off(): Loader",
1174
1183
  "name": "off",
@@ -1282,7 +1291,8 @@
1282
1291
  "character": 3
1283
1292
  },
1284
1293
  "raw": "/**\n * print to the screen with a red `✖` prefix. if message is empty, print the last logged message.\n */",
1285
- "comment": "print to the screen with a red `✖` prefix. if message is empty, print the last logged message."
1294
+ "comment": "print to the screen with a red `✖` prefix. if message is empty, print the last logged message.",
1295
+ "tags": []
1286
1296
  },
1287
1297
  "signature": "(method) Logger.consoleFailure(message?: string): void",
1288
1298
  "name": "consoleFailure",
@@ -1334,7 +1344,8 @@
1334
1344
  "character": 3
1335
1345
  },
1336
1346
  "raw": "/**\n * print to the screen with a red `⚠` prefix. if message is empty, print the last logged message.\n */",
1337
- "comment": "print to the screen with a red `⚠` prefix. if message is empty, print the last logged message."
1347
+ "comment": "print to the screen with a red `⚠` prefix. if message is empty, print the last logged message.",
1348
+ "tags": []
1338
1349
  },
1339
1350
  "signature": "(method) Logger.consoleWarning(message?: string): void",
1340
1351
  "name": "consoleWarning",
@@ -1386,7 +1397,8 @@
1386
1397
  "character": 3
1387
1398
  },
1388
1399
  "raw": "/**\n * a recent change on Windows caused the check mark to be printed as purple.\n * see https://github.com/chalk/chalk/issues/625\n */",
1389
- "comment": "a recent change on Windows caused the check mark to be printed as purple.\nsee https://github.com/chalk/chalk/issues/625"
1400
+ "comment": "a recent change on Windows caused the check mark to be printed as purple.\nsee https://github.com/chalk/chalk/issues/625",
1401
+ "tags": []
1390
1402
  },
1391
1403
  "signature": "(method) Logger.successSymbol(): string",
1392
1404
  "name": "successSymbol",
@@ -1428,7 +1440,7 @@
1428
1440
  "_legacy": {
1429
1441
  "scope": "teambit.harmony",
1430
1442
  "name": "logger",
1431
- "version": "0.0.980"
1443
+ "version": "0.0.982"
1432
1444
  },
1433
1445
  "_scope": "teambit.harmony"
1434
1446
  }
@@ -1626,7 +1638,8 @@
1626
1638
  "character": 1
1627
1639
  },
1628
1640
  "raw": "/**\n * use it for a long running process. upon creation it logs the `processDescription`.\n * if the process involves iteration over a list of items, such as running tag on a list of\n * components, then pass the `totalItems` as the total components in the list.\n * later, during the iteration, call `logProgress(componentName)`.\n * once done, call `end()`.\n * the status-line will show all messages in the terminal.\n * see README for more data.\n */",
1629
- "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total components in the list.\nlater, during the iteration, call `logProgress(componentName)`.\nonce done, call `end()`.\nthe status-line will show all messages in the terminal.\nsee README for more data."
1641
+ "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total components in the list.\nlater, during the iteration, call `logProgress(componentName)`.\nonce done, call `end()`.\nthe status-line will show all messages in the terminal.\nsee README for more data.",
1642
+ "tags": []
1630
1643
  },
1631
1644
  "signature": "class LongProcessLogger",
1632
1645
  "name": "LongProcessLogger",
@@ -2462,7 +2475,8 @@
2462
2475
  "character": 3
2463
2476
  },
2464
2477
  "raw": "/**\n * use it for a long running process. upon creation it logs the `processDescription`.\n * if the process involves iteration over a list of items, such as running tag on a list of\n * components, then pass the `totalItems` as the total of the total components in the list.\n * later, during the iteration, call `LongProcessLogger.logProgress(componentName)`.\n * once done, call `LongProcessLogger.end()`\n * the status-line will show all messages in the terminal.\n */",
2465
- "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total of the total components in the list.\nlater, during the iteration, call `LongProcessLogger.logProgress(componentName)`.\nonce done, call `LongProcessLogger.end()`\nthe status-line will show all messages in the terminal."
2478
+ "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total of the total components in the list.\nlater, during the iteration, call `LongProcessLogger.logProgress(componentName)`.\nonce done, call `LongProcessLogger.end()`\nthe status-line will show all messages in the terminal.",
2479
+ "tags": []
2466
2480
  },
2467
2481
  "signature": "(method) Logger.createLongProcessLogger(processDescription: string, totalItems?: number, shouldConsole?: ConsoleOnStart): LongProcessLogger",
2468
2482
  "name": "createLongProcessLogger",
@@ -2555,7 +2569,8 @@
2555
2569
  "character": 3
2556
2570
  },
2557
2571
  "raw": "/**\n * single status-line on the bottom of the screen.\n * the text is replaced every time this method is called.\n */",
2558
- "comment": "single status-line on the bottom of the screen.\nthe text is replaced every time this method is called."
2572
+ "comment": "single status-line on the bottom of the screen.\nthe text is replaced every time this method is called.",
2573
+ "tags": []
2559
2574
  },
2560
2575
  "signature": "(method) Logger.setStatusLine(text: string, shouldPrintOnCI?: boolean): void",
2561
2576
  "name": "setStatusLine",
@@ -2628,7 +2643,8 @@
2628
2643
  "character": 3
2629
2644
  },
2630
2645
  "raw": "/**\n * remove the text from the last line on the screen.\n */",
2631
- "comment": "remove the text from the last line on the screen."
2646
+ "comment": "remove the text from the last line on the screen.",
2647
+ "tags": []
2632
2648
  },
2633
2649
  "signature": "(method) Logger.clearStatusLine(): void",
2634
2650
  "name": "clearStatusLine",
@@ -2659,7 +2675,8 @@
2659
2675
  "character": 3
2660
2676
  },
2661
2677
  "raw": "/**\n * print to the screen. if message is empty, print the last logged message.\n */",
2662
- "comment": "print to the screen. if message is empty, print the last logged message."
2678
+ "comment": "print to the screen. if message is empty, print the last logged message.",
2679
+ "tags": []
2663
2680
  },
2664
2681
  "signature": "(method) Logger.console(message?: string, ...meta: any[]): void",
2665
2682
  "name": "console",
@@ -2739,6 +2756,7 @@
2739
2756
  "character": 3
2740
2757
  },
2741
2758
  "raw": "/**\n * @deprecated\n * try using consoleWarning. if not possible, rename this method to a clearer one\n */",
2759
+ "comment": "",
2742
2760
  "tags": [
2743
2761
  {
2744
2762
  "__schema": "TagSchema",
@@ -2830,6 +2848,7 @@
2830
2848
  "character": 3
2831
2849
  },
2832
2850
  "raw": "/**\n * @deprecated\n * try using consoleFailure. if not possible, rename this method to a clearer one\n */",
2851
+ "comment": "",
2833
2852
  "tags": [
2834
2853
  {
2835
2854
  "__schema": "TagSchema",
@@ -2921,7 +2940,8 @@
2921
2940
  "character": 3
2922
2941
  },
2923
2942
  "raw": "/**\n * print to the screen as a title, with bold text.\n */",
2924
- "comment": "print to the screen as a title, with bold text."
2943
+ "comment": "print to the screen as a title, with bold text.",
2944
+ "tags": []
2925
2945
  },
2926
2946
  "signature": "(method) Logger.consoleTitle(message: string): void",
2927
2947
  "name": "consoleTitle",
@@ -2973,7 +2993,8 @@
2973
2993
  "character": 3
2974
2994
  },
2975
2995
  "raw": "/**\n * print to the screen with a green `✔` prefix. if message is empty, print the last logged message.\n */",
2976
- "comment": "print to the screen with a green `✔` prefix. if message is empty, print the last logged message."
2996
+ "comment": "print to the screen with a green `✔` prefix. if message is empty, print the last logged message.",
2997
+ "tags": []
2977
2998
  },
2978
2999
  "signature": "(method) Logger.consoleSuccess(message?: string, startTime?: [number, number]): void",
2979
3000
  "name": "consoleSuccess",
@@ -3064,7 +3085,8 @@
3064
3085
  "character": 3
3065
3086
  },
3066
3087
  "raw": "/**\n * turn off the logger.\n */",
3067
- "comment": "turn off the logger."
3088
+ "comment": "turn off the logger.",
3089
+ "tags": []
3068
3090
  },
3069
3091
  "signature": "(method) Logger.off(): Loader",
3070
3092
  "name": "off",
@@ -3178,7 +3200,8 @@
3178
3200
  "character": 3
3179
3201
  },
3180
3202
  "raw": "/**\n * print to the screen with a red `✖` prefix. if message is empty, print the last logged message.\n */",
3181
- "comment": "print to the screen with a red `✖` prefix. if message is empty, print the last logged message."
3203
+ "comment": "print to the screen with a red `✖` prefix. if message is empty, print the last logged message.",
3204
+ "tags": []
3182
3205
  },
3183
3206
  "signature": "(method) Logger.consoleFailure(message?: string): void",
3184
3207
  "name": "consoleFailure",
@@ -3230,7 +3253,8 @@
3230
3253
  "character": 3
3231
3254
  },
3232
3255
  "raw": "/**\n * print to the screen with a red `⚠` prefix. if message is empty, print the last logged message.\n */",
3233
- "comment": "print to the screen with a red `⚠` prefix. if message is empty, print the last logged message."
3256
+ "comment": "print to the screen with a red `⚠` prefix. if message is empty, print the last logged message.",
3257
+ "tags": []
3234
3258
  },
3235
3259
  "signature": "(method) Logger.consoleWarning(message?: string): void",
3236
3260
  "name": "consoleWarning",
@@ -3282,7 +3306,8 @@
3282
3306
  "character": 3
3283
3307
  },
3284
3308
  "raw": "/**\n * a recent change on Windows caused the check mark to be printed as purple.\n * see https://github.com/chalk/chalk/issues/625\n */",
3285
- "comment": "a recent change on Windows caused the check mark to be printed as purple.\nsee https://github.com/chalk/chalk/issues/625"
3309
+ "comment": "a recent change on Windows caused the check mark to be printed as purple.\nsee https://github.com/chalk/chalk/issues/625",
3310
+ "tags": []
3286
3311
  },
3287
3312
  "signature": "(method) Logger.successSymbol(): string",
3288
3313
  "name": "successSymbol",
@@ -3324,7 +3349,7 @@
3324
3349
  "_legacy": {
3325
3350
  "scope": "teambit.harmony",
3326
3351
  "name": "logger",
3327
- "version": "0.0.980"
3352
+ "version": "0.0.982"
3328
3353
  },
3329
3354
  "_scope": "teambit.harmony"
3330
3355
  }
@@ -3433,7 +3458,8 @@
3433
3458
  "character": 1
3434
3459
  },
3435
3460
  "raw": "/**\n * use it for a long running process. upon creation it logs the `processDescription`.\n * if the process involves iteration over a list of items, such as running tag on a list of\n * components, then pass the `totalItems` as the total components in the list.\n * later, during the iteration, call `logProgress(componentName)`.\n * once done, call `end()`.\n * the status-line will show all messages in the terminal.\n * see README for more data.\n */",
3436
- "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total components in the list.\nlater, during the iteration, call `logProgress(componentName)`.\nonce done, call `end()`.\nthe status-line will show all messages in the terminal.\nsee README for more data."
3461
+ "comment": "use it for a long running process. upon creation it logs the `processDescription`.\nif the process involves iteration over a list of items, such as running tag on a list of\ncomponents, then pass the `totalItems` as the total components in the list.\nlater, during the iteration, call `logProgress(componentName)`.\nonce done, call `end()`.\nthe status-line will show all messages in the terminal.\nsee README for more data.",
3462
+ "tags": []
3437
3463
  },
3438
3464
  "signature": "class LongProcessLogger",
3439
3465
  "name": "LongProcessLogger",
@@ -3718,7 +3744,7 @@
3718
3744
  "componentId": {
3719
3745
  "scope": "teambit.harmony",
3720
3746
  "name": "logger",
3721
- "version": "0.0.980"
3747
+ "version": "0.0.982"
3722
3748
  },
3723
3749
  "taggedModuleExports": []
3724
3750
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_logger@0.0.980/dist/logger.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_logger@0.0.980/dist/logger.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_logger@0.0.982/dist/logger.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_logger@0.0.982/dist/logger.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@teambit/logger",
3
- "version": "0.0.980",
3
+ "version": "0.0.982",
4
4
  "homepage": "https://bit.cloud/teambit/harmony/logger",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "logger",
9
- "version": "0.0.980"
9
+ "version": "0.0.982"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
13
13
  "dreidels": "0.6.1",
14
14
  "pretty-time": "1.1.0",
15
15
  "@teambit/harmony": "0.4.6",
16
- "@teambit/cli": "0.0.887"
16
+ "@teambit/cli": "0.0.889"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/mocha": "9.1.0",