{"id":16305027,"url":"https://github.com/moznion/p6-log-minimal","last_synced_at":"2025-04-10T23:55:12.870Z","repository":{"id":145078079,"uuid":"43447912","full_name":"moznion/p6-Log-Minimal","owner":"moznion","description":"Minimal Logger for Perl6","archived":false,"fork":false,"pushed_at":"2023-04-08T20:07:45.000Z","size":37,"stargazers_count":3,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T23:55:08.180Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl 6","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-30T17:30:31.000Z","updated_at":"2022-08-03T20:59:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"70c1ee74-d63b-41d1-98e4-83de347e0e1b","html_url":"https://github.com/moznion/p6-Log-Minimal","commit_stats":{"total_commits":34,"total_committers":4,"mean_commits":8.5,"dds":0.1470588235294118,"last_synced_commit":"3d3b8d481b84b1babdf7b27d1cc87f9b7ddbace0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-Log-Minimal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-Log-Minimal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-Log-Minimal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp6-Log-Minimal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/p6-Log-Minimal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317701,"owners_count":21083528,"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-10T21:05:29.464Z","updated_at":"2025-04-10T23:55:12.852Z","avatar_url":"https://github.com/moznion.png","language":"Perl 6","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/moznion/p6-Log-Minimal.svg?branch=master)](https://travis-ci.org/moznion/p6-Log-Minimal)\n\nNAME\n====\n\nLog::Minimal - Minimal and customizable logger for perl6\n\nSYNOPSIS\n========\n\n    use Log::Minimal;\n    my $log = Log::Minimal.new;\n\n    $log.critf('foo'); # 2010-10-20T00:25:17Z [CRITICAL] foo at example.p6 line 12;\n    $log.warnf(\"%d %s %s\", 1, \"foo\", $uri);\n    $log.infof('foo');\n    $log.debugf(\"foo\"); # print if %*ENV\u003cLM_DEBUG\u003e is true value\n\n    # with full stack trace\n    $log.critff(\"%s\",\"foo\"); # 2010-10-20T00:25:17Z [CRITICAL] foo at lib/Example.pm6 line 10, example.p6 line 12\n    $log.warnff(\"%d %s %s\", 1, \"foo\", $uri);\n    $log.infoff('foo');\n    $log.debugff(\"foo\"); # print if %*ENV\u003cLM_DEBUG\u003e is true value\n\n    # die with formatted message\n    $log.errorf('foo');\n    $log.errorff('%s %s', $code, $message);\n\nDESCRIPTION\n===========\n\nLog::Minimal is a minimal and customizable logger for perl6. This logger provides logging functions according to logging level with line (or stack) trace.\n\nThis package is perl6 port of Log::Minimal of perl5.\n\nMETHODS\n=======\n\ncritf(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n----------------------------------------------------------\n\n    $log.critf(\"could't connect to example.com\");\n    $log.critf(\"Connection timeout timeout:%d, host:%s\", 2, \"example.com\");\n\nDisplay CRITICAL messages. When two or more arguments are passed to the method, the first argument is treated as a format of sprintf.\n\nwarnf(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n----------------------------------------------------------\n\nDisplay WARN messages.\n\ninfof(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n----------------------------------------------------------\n\nDisplay INFO messages.\n\ndebugf(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n-----------------------------------------------------------\n\nDisplay DEBUG messages, if %*ENLM_DEBUG is true value.\n\ncritff(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n-----------------------------------------------------------\n\n    $log.critff(\"could't connect to example.com\");\n    $log.critff(\"Connection timeout timeout:%d, host:%s\", 2, \"example.com\");\n\nDisplay CRITICAL messages with stack trace.\n\nwarnff(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n-----------------------------------------------------------\n\nDisplay WARN messages with stack trace.\n\ninfoff(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n-----------------------------------------------------------\n\nDisplay INFO messages with stack trace.\n\ndebugff(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n------------------------------------------------------------\n\nDisplay DEBUG messages with stack trace, if %*ENLM_DEBUG is true value.\n\nerrorf(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n-----------------------------------------------------------\n\ndie with formatted $message\n\n    $log.errorf(\"critical error\");\n\nerrorff(Log::Minimal:D: ($message:Str|$format:Str, *@list));\n------------------------------------------------------------\n\ndie with formatted $message with stack trace\n\nCUSTOMIZATION\n=============\n\n`%*ENV\u003cLM_DEBUG\u003e` and `$.env-debug`\n-----------------------------------\n\n%*ENLM_DEBUG must be true if you want to print debugf and debugff messages.\n\nYou can change variable name from LM_DEBUG to arbitrary string which is specified by `$.env-debug` in use instance.\n\n    use Log::Minimal;\n\n    my $log = Log::Minimal.new(:env-debug('FOO_DEBUG'));\n\n    %*ENV\u003cLM_DEBUG\u003e  = True;\n    %*ENV\u003cFOO_DEBUG\u003e = False;\n    $log.debugf(\"hello\"); # no output\n\n    %*ENV\u003cFOO_DEBUG\u003e = True;\n    $log.debugf(\"world\"); # print message\n\n`%*ENV\u003cLM_COLOR\u003e` and `$.color`\n-------------------------------\n\n`%*ENV\u003cLM_COLOR\u003e` is used as default value of `$.color`. If you want to colorize logging message, you specify true value into `%*ENV\u003cLM_COLOR\u003e` or `$.color` of instance.\n\n    use Log::Minimal;\n\n    my $log = Log::Minimal.new;\n    %*ENV\u003cLM_COLOR\u003e  = True;\n    $log.infof(\"hello\"); # output colorized message\n\nor\n\n    use Log::Minimal;\n\n    my $log = Log::Minimal.new;\n    $log.color = True;\n    $log.infof(\"hello\"); # output colorized message\n\n`$.print`\n---------\n\nTo change the method of outputting the log, set `$.print` of instance.\n\n    my $log = Log::Minimal.new;\n    $log.print = sub (:$time, :$log-level, :$messages, :$trace) {\n        note \"[$log-level] $messages $trace\"; # without time stamp\n    }\n    $log.critf('foo'); # [CRITICAL] foo at example.p6 line 12;\n\ndefault is\n\n    sub (:$time, :$log-level, :$messages, :$trace) {\n        note \"$time [$log-level] $messages $trace\";\n    }\n\n`$.die`\n-------\n\nTo change the format of die message, set `$.die` of instance.\n\n    my $log = Log::Minimal.new;\n    $log.print = sub (:$time, :$log-level, :$messages, :$trace) {\n        die \"[$log-level] $messages\"; # without time stamp and trace\n    }\n    $log.errorf('foo');\n\ndefault is\n\n    sub (:$time, :$log-level, :$messages, :$trace) {\n        Log::Minimal::Error.new(message =\u003e \"$time [$log-level] $messages $trace\").die;\n    }\n\n`$.default-log-level`\n---------------------\n\nLevel for output log.\n\n    my $log = Log::Minimal.new;\n    $log.default-log-level = Log::Minimal::WARN;\n    $log.infof(\"foo\"); # print nothing\n    $log.warnf(\"foo\"); # print\n\nSupport levels are DEBUG, INFO, WARN, CRITICAL, Error and MUTE. These levels are exposed by enum (e.g. Log::Minimal::DEBUG). If MUTE is set, no output except `errorf` and `errorff`. Default log level is DEBUG.\n\n`$.autodump`\n------------\n\nSerialize message with `.perl`.\n\n    my $log = Log::Minimal.new;\n    $log.warnf(\"%s\", {foo =\u003e 'bar'}); # foo\\tbar\n\n    temp $log.autodump = True;\n    warnf(\"dump is %s\", {foo=\u003e'bar'}); # :foo(\"bar\")\n\n`$.default-trace-level`\n-----------------------\n\nThis variable determines how many additional call frames are to be skipped. Defaults to 0.\n\n`$.escape-whitespace`\n---------------------\n\nIf this value is true, whitespace other than space will be represented as [\\n\\t\\r]. Defaults to True.\n\n`$.timezone`\n------------\n\nDefault, this value is Nil means Log::Minimal determines timezone automatically from your environment.\n\nIf you specify this value, Log::Minimal uses that timezone.\n\n    my $timezone = DateTime.new('2015-12-24T12:23:00+0900').timezone; # \u003c= 32400\n    my $log = Log::Minimal.new(:$timezone);\n    $log.critff(\"%s\",\"foo\"); # 2010-10-20T00:25:17+09:00 [CRITICAL] foo at lib/Example.pm6 line 10, example.p6 line 12\n\nSEE ALSO\n========\n\n[Log::Minimal of perl5](https://metacpan.org/pod/Log::Minimal)\n\nCOPYRIGHT AND LICENSE\n=====================\n\n    Copyright 2015 moznion \u003cmoznion@gmail.com\u003e\n\n    This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.\n\nAnd original perl5's Log::Minimal is\n\n    This software is copyright (c) 2013 by Masahiro Nagano \u003ckazeburo@gmail.com\u003e.\n\n    This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fp6-log-minimal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fp6-log-minimal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fp6-log-minimal/lists"}