{"name":"@percy/logger","version":"1.8.0","license":"MIT","_id":"@percy/logger@1.8.0","homepage":"https://github.com/percy/cli#readme","bugs":{"url":"https://github.com/percy/cli/issues"},"dist":{"shasum":"e85f60dff1b118644f91f6d73c08a455169f57af","tarball":"http://registry-npm.ywwl.com/@percy/logger/download/@percy/logger-1.8.0.tgz","fileCount":7,"integrity":"sha512-z1PNQFXDr4+y+a6FPzsZBuMttr0VrRpYSpxRhvhTZTjnLsBvgQ6VP2GxyFlp7E3Y4aG9Lmzau71s2Nlb35Ylgg==","signatures":[{"sig":"MEQCIHsnnkUant22rlQxgSksHl3nalNCE9VKeiBYw36QkWqiAiAEqqe9jMAWXyuZJWo328HS0XsfAAkmBUb9SzA3Vm7OzA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6u4RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrArA/9HNNODFdbSCcr3rAPdRKyKEb5SlnSgSfBlymvw4jNb6ua2lTH\r\nQByptU9zYttV5l39UyN0CjKuSysjY0QmLlR9vLwH7FdwSbg0uxU809pp2UfN\r\n1lllVFV5dH4zcjGDlEKAJDnNyRndPaDBrtoTJHoAnAM6Ol2R2kUKfKgkI9yR\r\nuZhFGLcke3+qVMkWoh3HFe9Ghc/vfNAsRigeEcx+igXU8r7Jeqr2KB0jjpWm\r\nKT9CAXwynSIXpPRtwDDiT4uou+D9+Im7E9TJGoBkUttf3nVqLWV1cmPZAC5C\r\n/Idv2HkduBd9F1KB7JXcHLvv7ozhkCL1XHis9EtIyDURoEJP+TmBD99LAMm7\r\njZs5KdjpFuYGSr6fthQ813fn+854a/XS1W6m4PlWtqibB1YsJ/RP6xX+UtXu\r\nJZD4LKceYqJdLqNY6/XTbuygnaH1UqJBYw9SI3b0K19LF7yt66O2GYHxvlkE\r\nZThO7szCBPQpWrcqEON5QPGTTHnIuATj5ZIKZes7S4AO+MCd/Zj/zvWaDq46\r\n/EP6Tjbr7pEGQoLIVlFCwLcWaFh2xF/KfDrpn5RdaXZemPLq2+exOfMkfQRP\r\n/QBRvPEohT+b50HVffLot8el3KoyBGoog0NvjcIM/YNRCiNy87KjFf9j4RDj\r\nIEv4+9S/nuDDvLAaT+mr8XroXZguKka5BK0=\r\n=sv/1\r\n-----END PGP SIGNATURE-----\r\n","size":5998,"noattachment":false,"key":"/@percy/logger/-/@percy/logger-1.8.0.tgz"},"main":"./dist/index.js","type":"module","engines":{"node":">=14"},"exports":{".":"./dist/index.js","./utils":"./dist/utils.js","./test/client":"./test/client.js","./test/helpers":"./test/helpers.js"},"gitHead":"596808e5775a87514d3c7ffc8ac593cdc9289ad7","scripts":{"lint":"eslint --ignore-path ../../.gitignore .","test":"node ../../scripts/test","build":"node ../../scripts/build","test:coverage":"yarn test --coverage"},"_npmUser":{"name":"percy-admin","email":"apps+npm@percy.io"},"repository":{"url":"git+https://github.com/percy/cli.git","type":"git","directory":"packages/logger"},"_npmVersion":"lerna/5.3.0/node@v14.20.0+x64 (linux)","description":"Common logger used throughout the Percy CLI and SDKs.","directories":{},"_nodeVersion":"14.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/logger_1.8.0_1659563537027_0.9745073461687332","host":"s3://npm-registry-packages"},"readme":"# @percy/logger\n\nCommon logger used throughout the Percy CLI and SDKs.\n\n- [Usage](#usage)\n  - [`logger()`](#loggerdebug)\n  - [`logger.loglevel()`](#loggerloglevel)\n  - [`logger.format()`](#loggerformat)\n  - [`logger.query()`](#loggerquery)\n\n## Usage\n\n``` js\nimport logger from '@percy/logger'\n\nconst log = logger('foobar')\n\nlog.info('info message')\nlog.error('error message')\nlog.warn('warning message')\nlog.debug('debug message')\nlog.deprecated('deprecation message')\n```\n\n### `logger([debug])`\n\nCreates a group of logging functions that will be associated with the provided `debug` label. When\ndebug logging is enabled, this label is printed with the `[percy:*]` label and can be filtered via\nthe `PERCY_DEBUG` environment variable.\n\n``` js\nPERCY_DEBUG=\"one:*,*:a,-*:b\"\n\nlogger.loglevel('debug')\n\nlogger('one').debug('test')\nlogger('one:a').debug('test')\nlogger('one:b').debug('test')\nlogger('one:c').debug('test')\nlogger('two').debug('test')\nlogger('two:a').debug('test')\n\n// only logs from the matching debug string are printed\n//=> [percy:one] test\n//=> [percy:one:a] test\n//=> [percy:one:c] test\n//=> [percy:two:a] test\n```\n\n### `logger.loglevel([level][, flags])`\n\nSets or retrieves the log level of the shared logger. If the second argument is provided, `level` is\ntreated as a fallback when all logging flags are `false`. When no arguments are provided, the method\nwill return the current log level of the shared logger.\n\n``` js\nlogger.loglevel('info', { verbose: true })\nlogger.loglevel() === 'debug'\n\nlogger.loglevel('info', { quiet: true })\nlogger.loglevel() === 'warn'\n\nlogger.loglevel('info', { silent: true })\nlogget.loglevel() === 'silent'\n\nlogger.loglevel('info')\nlogger.loglevel() === 'info'\n```\n\n### `logger.format(message, debug[, level])`\n\nReturns a formatted `message` depending on the provided level and logger's own log level. When\ndebugging, the `debug` label is added to the prepended `[percy:*]` label.\n\n``` js\nlogger.format('foobar', 'test')\n//=> [percy] foobar\n\nlogger.loglevel('debug')\nlogger.format('foobar', 'test', warn')\n//=> [percy:test] foobar (yellow for warnings)\n```\n\n### `logger.query(filter)`\n\nReturns an array of logs matching the provided filter function.\n\n``` js\nlet logs = logger.query(log => {\n  return log.level === 'debug' &&\n    log.message.match(/foobar/)\n})\n```\n","publish_time":1659563537225,"maintainers":[{"name":"percy-admin","email":"apps+npm@percy.io"}],"_cnpm_publish_time":1659563537225,"dist-tags":{"alpha":"1.31.15-alpha.0","beta":"1.33.2-beta.0","latest":"1.33.1"}}