{"id":16758406,"url":"https://github.com/kessler/node-yalla","last_synced_at":"2025-04-10T17:14:00.680Z","repository":{"id":20719141,"uuid":"24003201","full_name":"kessler/node-yalla","owner":"kessler","description":"A minimalistic logging lib","archived":false,"fork":false,"pushed_at":"2016-08-08T10:54:50.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T03:31:53.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dzenbot/DZNEmptyDataSet","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kessler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-13T19:11:59.000Z","updated_at":"2019-08-13T15:50:38.000Z","dependencies_parsed_at":"2022-09-10T23:01:17.127Z","dependency_job_id":null,"html_url":"https://github.com/kessler/node-yalla","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fnode-yalla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fnode-yalla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fnode-yalla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kessler%2Fnode-yalla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kessler","download_url":"https://codeload.github.com/kessler/node-yalla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045230,"owners_count":21038553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T04:05:10.987Z","updated_at":"2025-04-10T17:14:00.656Z","avatar_url":"https://github.com/kessler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yet Another Logging Library (A) [![Build Status](https://secure.travis-ci.org/kessler/node-yalla.png?branch=master)](http://travis-ci.org/kessler/node-yalla) [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nA minimalistic logging lib\n\n(For the similarly named but completely unrelated .NET library please see [YALLA.NET](http://yalladotnet.github.io/Yalla ))\n\n### simple usage\n```javascript\n\tvar yalla = require('yalla')\n\n\tvar log = new yalla.Logger(yalla.LogLevel.SILLY))\n\t//or\n\t//var log = new yalla.Logger('silly'))\n\n\tif (log.isSilly())\n\t\tlog.silly('silly %s', util.inspect(something))\n\n\tlog.debug('debug')\n\tlog.info('info')\n\tlog.warn('warning')\n\tlog.error(new Error())\n\n\t// change to warn\n\tlog.setLevel(yalla.LogLevel.WARN)\n```\n\n### custom output\n```javascript\n\tvar yalla = require('yalla')\n\tvar util = require('util')\n\n\tvar log = new yalla.Logger()\n\n\t// clear all other outputs (including defaults)\n\tlog.clearOutputs()\n\n\tvar stream = fs.createWriteStream('my.log')\n\n\tlog.addOutput(function(args) {\n\t\tstream.write(util.format.apply(util, args))\n\t\tstream.write('\\n')\n\t})\n```\n\n### fancy custom output\nexample for coloring for chrome console\n```javascript\nvar yalla = require('yalla')\nvar LogLevel = yalla.LogLevel\n\nvar log = new Logger(LogLevel.DEBUG)\nlog.clearOutputs()\n\nvar consoleLogColoredOutput = {\n\twrite: function(args) {\n\t\tconsole.log.apply(console, args)\n\t},\n\tprepare: function(level, label, args) {\n\t\tlabel = '%c ' + label\n\n\t\tvar style = 'color: black'\n\n\t\tif (level === LogLevel.DEBUG) {\n\t\t\tstyle = 'color: green'\n\t\t}\n\n\t\tif (level === LogLevel.INFO) {\n\t\t\tstyle = 'color: blue'\n\t\t}\n\n\t\tif (level === LogLevel.WARN) {\n\t\t\tstyle = 'color: orange'\n\t\t}\n\n\t\tif (level === LogLevel.ERROR) {\n\t\t\tstyle = 'color: red'\n\t\t}\n\n\t\targs.splice(1, 0, style)\n\n\t\treturn Logger.addLogLevelLabel(level, label, args)\n\t}\n}\n\nlog.addOutput(consoleLogColoredOutput)\n```\n\n### named logs\n```javascript\n\tvar yalla = require('yalla')\n\n\tvar log = new yalla.Logger({\n\t\taddTimestamp: false, // optional\n\t\tlevel: 'silly', // optional\n\t\tname: 'foo'\n\t}))\n\n\tlog.debug('debug') // prints [foo] debug\n```\n\n\n### LogLevels\nSILLY, DEBUG, INFO, WARN, ERROR, SILENT\n\nIn all places level constants are interchangable with their lower case string representation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fnode-yalla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkessler%2Fnode-yalla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkessler%2Fnode-yalla/lists"}