{"id":17721136,"url":"https://github.com/sdondley/log-log4perl-shortcuts","last_synced_at":"2025-03-31T13:25:56.819Z","repository":{"id":89032534,"uuid":"120522180","full_name":"sdondley/Log-Log4perl-Shortcuts","owner":"sdondley","description":null,"archived":false,"fork":false,"pushed_at":"2019-02-21T20:59:42.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T12:52:20.098Z","etag":null,"topics":["logging","logs","perl","perl5","perl5-module"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdondley.png","metadata":{"files":{"readme":"README.mkdn","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-06T20:56:01.000Z","updated_at":"2019-02-21T20:59:41.000Z","dependencies_parsed_at":"2023-03-13T18:15:14.776Z","dependency_job_id":null,"html_url":"https://github.com/sdondley/Log-Log4perl-Shortcuts","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdondley%2FLog-Log4perl-Shortcuts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdondley%2FLog-Log4perl-Shortcuts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdondley%2FLog-Log4perl-Shortcuts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdondley%2FLog-Log4perl-Shortcuts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdondley","download_url":"https://codeload.github.com/sdondley/Log-Log4perl-Shortcuts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246473273,"owners_count":20783236,"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":["logging","logs","perl","perl5","perl5-module"],"created_at":"2024-10-25T15:31:22.979Z","updated_at":"2025-03-31T13:25:56.788Z","avatar_url":"https://github.com/sdondley.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nLog::Log4perl::Shortcuts - shortcut functions to make log4perl even easier\n\n# VERSION\n\nversion 0.024\n\n# OVERVIEW\n\nProvides an easy-to-use wrapper for [Log::Log4perl](https://metacpan.org/pod/Log::Log4perl).\n\n# SYNOPSIS\n\nInstead of this:\n\n    use Log::Log4perl;\n\n    sub do_something {\n      my $logger = Log::Log4perl-\u003eget_logger('my.category');\n\n      $log-\u003einfo('I am doing something.');\n    }\n\nYou can save some keystrokes and do this:\n\n    use Log::Log4perl::Shortcuts qw(:all);\n\n    sub do_something {\n      logi('I am doing something.', 'my.category');\n    }\n\n# DESCRIPTION\n\nThis modules provides shortcut functions for the standard log levels provided by\n[Log::Log4perl](https://metacpan.org/pod/Log::Log4perl) plus some additional functionality to make it more convenient.\n\nAll functions can be imported into your module or script with the `:all` import\ntag or they can be individually imported.\n\n## Log level functions\n\nThere are the six log level functions provided, one for each of the standard log\nlevels provided by the Log4perl module. Each of them accepts an argument for the\nlog message plus an optional category argument.\n\nThe **$category** arguments, if supplied, are appended to the name of the calling\npackage where the log command was invoked. For example, if `logi('Info log entry', 'my_category')`\nis called from package `Foo::Bar`, the log entry will be made with the category:\n\nThe **$options** arguments, if avaiable, supply addition options to the `loge`\nand `logf` functions. If ` { show_callers =\u003e 1 } ` is supplied, a stack trace\nwill be printed out below the error or fatal message.\n\n    Foo::Bar.my_category\n\n# Functions\n\n## logt ($msg, \\[$category\\])\n\nPrints a message to the _trace_ logger when the log level is set to **TRACE** or above.\n\n## logd ($msg, \\[$category\\])\n\nPrint messages when the log level is set to **DEBUG** or above. **$category**\nargument is optional.\n\n**$msg** is intended to be a scalar variable or reference to a data structure which\nwill be output as a message after getting passed through [Data::Dumper](https://metacpan.org/pod/Data::Dumper).\n\n## logi ($msg, \\[$category\\])\n\nPrints a message to the _info_ logger when the log level is set to **INFO** or above.\n\n## logw ($msg, \\[$category\\])\n\nPrints a message to the _warn_ logger when the log level is set to **WARN** or above.\n\n## loge ($msg, \\[$category\\], \\[{ $options =\u003e value, ... }\\])\n\nPrints a message to the _error_ logger when the log level is set to **ERROR** or above.\n\n## logf ($msg, \\[$category\\], \\[{ $options =\u003e value, ... }\\])\n\nPrints a message to the _fatal_ logger when the log level is set to **FATAL** or above.\n\n# Special Functions\n\n## logc (\\[$category\\])\n\nPrints call stack when log level is set to **TRACE** or above. Note that no\nmessage argument is used by this function.\n\n## set\\_log\\_config ($file, \\['MODULE::NAME'\\])\n\nChanges the log configuration file to the path and/or\nfile name specified with `$file`.\n\n`Log::Log4perl::Shortcuts` will first try to locate the config file on your\nhard drive using the `$file` argument by itself. If that's not\nsuccessful, it will attempt to locate the file in the `log_config` directory\nwithin your module's shared directory. If that fails, the `log_config` directory\nfor `Log::Log4perl::Shortcuts` will be searched. This directory can be\nfound in `Log-Log4perl-Shortcuts` directory that [File::UserConfig](https://metacpan.org/pod/File::UserConfig)\ninstalled in your home directory when you installed `Log::Log4perl::Shortcuts`.\n\nYou can also supply the name of another module installed on your system which\nhas its logs located in a `log_config` directory within that module's shared\ndirectory.\n\n## set\\_log\\_level ($log\\_level)\n\nChange the log level. Should be one of 'trace', 'debug', 'info', 'warn', 'error',\nor 'fatal'.\n\n# CONFIGURATION AND ENVIRONMENT\n\nCustom log configuration files work seamlessly when `Log::Log4perl::Shortcuts`\nis being called from within a module that uses the [File::UserConfig](https://metacpan.org/pod/File::UserConfig) module\nto create a directory in your home directory for placing configuration files.\nIf this is the case, place your custom log files into your module's `log_config`\ndirectory so your custom log files can be found. On a Mac, by default, this\ndirectory is found in the `Application Support/Your-Module-Name` in your\nuser's home directory.\n\nYou may still use `Log::Log4perl::Shortcuts` with a custom log file without\nusing the `File::UserConfig` module, but you will need to specify the complete\npath to the custom log file when calling the `set_log_config` function or place\nyour custom log configuration files in the `Log-Log4perl-Shortcuts/log_config`\ndirectory found in your home directory.\n\n# REQUIRES\n\n- [Carp](https://metacpan.org/pod/Carp)\n- [Data::Dumper](https://metacpan.org/pod/Data::Dumper)\n- [Exporter](https://metacpan.org/pod/Exporter)\n- [File::UserConfig](https://metacpan.org/pod/File::UserConfig)\n- [Log::Log4perl](https://metacpan.org/pod/Log::Log4perl)\n- [Log::Log4perl::Level](https://metacpan.org/pod/Log::Log4perl::Level)\n- [Module::Data](https://metacpan.org/pod/Module::Data)\n- [Path::Tiny](https://metacpan.org/pod/Path::Tiny)\n\n# SUPPORT\n\n## Perldoc\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Log::Log4perl::Shortcuts\n\n## Websites\n\nThe following websites have more information about this module, and may be of help to you. As always,\nin addition to those websites please use your favorite search engine to discover more resources.\n\n- MetaCPAN\n\n    A modern, open-source CPAN search engine, useful to view POD in HTML format.\n\n    [https://metacpan.org/release/Log-Log4perl-Shortcuts](https://metacpan.org/release/Log-Log4perl-Shortcuts)\n\n## Source Code\n\nThe code is open to the world, and available for you to hack on. Please feel free to browse it and play\nwith it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull\nfrom your repository :)\n\n[https://github.com/sdondley/Log-Log4perl-Shortcuts](https://github.com/sdondley/Log-Log4perl-Shortcuts)\n\n    git clone git://github.com/sdondley/Log-Log4perl-Shortcuts.git\n\n# BUGS AND LIMITATIONS\n\nYou can make new bug reports, and view existing ones, through the\nweb interface at [https://github.com/sdondley/Log-Log4perl-Shortcuts/issues](https://github.com/sdondley/Log-Log4perl-Shortcuts/issues).\n\n# INSTALLATION\n\nSee perlmodinstall for information and options on installing Perl modules.\n\n# AUTHOR\n\nSteve Dondley \u003cs@dondley.com\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2018 by Steve Dondley.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdondley%2Flog-log4perl-shortcuts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdondley%2Flog-log4perl-shortcuts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdondley%2Flog-log4perl-shortcuts/lists"}