{"id":22468103,"url":"https://github.com/patternslib/logging","last_synced_at":"2025-03-27T15:43:31.505Z","repository":{"id":5554472,"uuid":"6758963","full_name":"Patternslib/logging","owner":"Patternslib","description":"Minimal logging framework","archived":false,"fork":false,"pushed_at":"2015-04-27T13:17:40.000Z","size":188,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-01T20:07:33.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Patternslib.png","metadata":{"files":{"readme":"README.md","changelog":"changes.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-19T10:59:37.000Z","updated_at":"2015-04-27T13:17:40.000Z","dependencies_parsed_at":"2022-07-16T18:46:19.672Z","dependency_job_id":null,"html_url":"https://github.com/Patternslib/logging","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patternslib%2Flogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patternslib%2Flogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patternslib%2Flogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Patternslib%2Flogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Patternslib","download_url":"https://codeload.github.com/Patternslib/logging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245873798,"owners_count":20686654,"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-12-06T11:15:09.064Z","updated_at":"2025-03-27T15:43:31.482Z","avatar_url":"https://github.com/Patternslib.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/Patternslib/logging.png?branch=master)](https://travis-ci.org/Patternslib/logging)\n\nIntroduction\n------------\n\nThis is a minimal logging framework for javascript. It implements a subset\nof the [log4javascript](http://log4javascript.org/) API, which itself is\ninspired by [log4j](http://logging.apache.org/log4j/). Since log4javascript\nis huge (180kB) and our needs were small we wrote this 8kB replacement which\nstill supports configurable log levels and hierarchical loggers.\n\n*logging* can be used both standalone or as an [AMD\nmodule](https://github.com/amdjs/amdjs-api/wiki/AMD).  If you do not use AMD\nthe logging API is accessible via a global ``logging`` object.\n\n~~~javascript\nlogging.info(\"Hello, world!\");\n});\n~~~\n\nIf you are using an AMD system such as [RequireJS](http://requirejs.org/)\nlogging will registered as a module and no globals will be installed. \n\n~~~javascript\ndefine([\"logging\"], function(logging) {\n    logging.info(\"Initialisating MyModule\");\n});\n~~~\n\n\nConfiguring through URL\n-----------------------\n\nTo facilitate debugging you can change the default log level through the URL\nquery string by adding ``loglevel`` options.\n\n* ``http://www.example.com/?loglevel=DEBUG`` changes the default log level\n  to ``DEBUG``.\n* ``http://www.example.com/?loglevel-inject=DEBUG`` changes the log level\n  for just the inject pattern to ``DEBUG``.\n* ``http://www.example.com/?loglevel=ERROR\u0026loglevel-inject=INFO``\n  changes the standard log level error, but enables messages at the ``INFO``\n  level for the inject pattern.\n\n\nAPI reference\n-------------\n\n\n### logging.Level\n\nThis is an object which defines all available logging levels: ``DEBUG``,\n``INFO``, ``WARN``, ``ERROR`` and ``FATAL``.\n\n\n### logging.setEnabled(enabled)\n\n* ``enabled`` (boolean): flag indicating if logging should be enabled\n\nThis function disables or enables all logging functionality.\n\n\n### logging.setLevel(level)\n\n* ``level``: new logging level\n\nUse this function to change the logging level. The default level is INFO. To\nchange the level to DEBUG you can use this:\n\n~~~javascript\nlogging.setLevel(logging.Level.DEBUG);\n~~~\n\n *Please note that this only changes the root logging level.* You can set a\n different logging for individual lggers as well:\n\n~~~javascript\nvar log = logging.getLogger(\"MyModule\");\nlog.setLevel(logging.Level.DEBUG);\n~~~\n\n### logging.getLogger(name)\n\n* ``name`` (string): name of the logger\n\nRetrieve, and optionally create, a named logger instance.\n\n\nThe logging object (`log` in the code example) exposes several methods to log\ninformation at various log levels: \n\n* `debug` is used to log debug messages. There are normally not shown.\n* `info` is used to log informational messages. These are normally not shown.\n* `warn` is used to log warnings. These are normally shown.\n* `error` is used to log errors. There are normally shown.\n* `fatal` is used to log fatal errors. There are normally shown.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternslib%2Flogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatternslib%2Flogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternslib%2Flogging/lists"}