{"id":20980503,"url":"https://github.com/hyperjumptech/hyperlog","last_synced_at":"2025-03-13T10:17:14.269Z","repository":{"id":252040413,"uuid":"839211707","full_name":"hyperjumptech/hyperlog","owner":"hyperjumptech","description":"A logging framework for golang programming language","archived":false,"fork":false,"pushed_at":"2024-08-08T04:52:10.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-20T06:33:01.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperjumptech.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":"2024-08-07T07:01:50.000Z","updated_at":"2024-08-08T04:52:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"68b2df03-9f36-471b-a231-c69fa436f062","html_url":"https://github.com/hyperjumptech/hyperlog","commit_stats":null,"previous_names":["hyperjumptech/hyperlog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyperlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyperlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyperlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjumptech%2Fhyperlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperjumptech","download_url":"https://codeload.github.com/hyperjumptech/hyperlog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243382935,"owners_count":20282051,"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-11-19T05:28:56.414Z","updated_at":"2025-03-13T10:17:14.233Z","avatar_url":"https://github.com/hyperjumptech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hyperlog\n\nSimple logging framework that works.\n\n## Importing\n\n```bash\n$ go get github.com/hyperjumptech/hyperlog\n```\n\n## Features\n\nIt enable the following capabilities:\n\n- Log Level\n- JSON Log Output\n- Log Hook and triggers on any level\n- Shutdown Hook\n- Log to any implementation io.Writer\n- Writer implementation to write log for rolling based on time\n- Writer implementation to write log for rolling based on size\n- Log writer with \"Attribute\" (a.k.a \"Field\")\n- Http middleware to log Request/Response\n\n## Using hyperlog\n\n### Preparation\n\nJust import the library, as simple as that.\n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n```\n\n### Configure\n\n### Logging\n\nThe following can be use for logging straight away...\n```go\nfunc Trace(str ...interface{})\nfunc Debug(str ...interface{})\nfunc Info(str ...interface{})\nfunc Warn(str ...interface{})\nfunc Error(str ...interface{})\nfunc Fatal(str ...interface{})\n\nfunc Tracef(format string,  ...interface{})\nfunc Debugf(format string,  arg ...interface{})\nfunc Infof(format string,  arg ...interface{})\nfunc Warnf(format string,  arg ...interface{})\nfunc Errorf(format string,  arg ...interface{})\nfunc Fatalf(format string,  arg ...interface{})\n```\n\nSo you can directly use them like ...\n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n\nfunc DoSomething() {\n    hyperlog.Warn(\"This is a warning\")\n}\n\nfunc DoSomethingAgain() {\n    hyperlog.Warnf(\"This is a %s\", \"warning\")\n}\n```\n\nOr you can create a logger using `WithAttribute` to add some specific attribute.\n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n\nfunc LogIt() {\n    log1 := hyperlog.WithAttribute(\"key\", \"Value One\")\n    log2 := hyperlog.WithAttribute(\"moreKey\", \"More Value\")\n    log3 := log2.WithAttribute(\"anotherKey\", \"More Value\")\n\n    log1.Info(\"Hello One\")\n    log2.Info(\"More Hello\")\n    log3.Info(\"Another log\")\n}\n```\n\nwhich will log something like the following (in plain format)\n\n```text\n[INFO] 2024-07-21T10:10:00 Hello One key=\"Value One\"\n[INFO] 2024-07-21T10:10:00 More Hello moreKey=\"More Value\"\n[INFO] 2024-07-21T10:10:00 Another log moreKey=\"More Value\" anotherKey=\"More Value\"\n```\n\n### Changing Output Format\n\nYou can generate log in either \"JSON\" or \"Plain\" format.\n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n\nfunc init() {\n    OutFormat = JSONFormat // this will produce log JSON format\n\t... or ...\n    OutFormat = PlainFormat // this will produce log in Plain Text format\n}\n```\n\nso, a call like this ...\n\n```go\nhyperlog.Error(\"an error has occurred\")\n```\n\nwill log ...\n\nJSON\n\n```text\n{\"lvl\"=\"error\",\"time\":\"2024-07-21T10:10:00\",\"msg\":an error has occurred\"}\n```\n\nor Plain Text\n\n```text\n[error] 2024-07-21T10:10:00 an error has occurred\n```\n\n### Changing Writer (output target)\n\nYou can change the logging target like following.\n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n\nfunc init() {\n\thyperlog.SetWriter(os.StdOut)\n}\n```\n\nor \n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n\nfunc init() {\n\thyperlog.SetWriter(os.StdErr)\n}\n```\n\nor \n\n```go\nimport \"github.com/hyperjumptech/hyperlog\"\n\ntype CustomWriter struct {}\nfunc (c *CustomWriter) Write(b []byte) (written int, err error) {\n\t// some io.Writer() logic.\n}\n\nfunc init() {\n\thyperlog.SetWriter(\u0026CustomWriter{})\n}\n```\n\nThis you can set the log target as specified.\n\n### Hooks\n\n__More documentation will be added soon__\n\n### File Based Writer\n\n#### Rolling Log File based on Time\n\n__More documentation will be added soon__\n\n#### Rolling Log File based on file size\n\n__More documentation will be added soon__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjumptech%2Fhyperlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperjumptech%2Fhyperlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjumptech%2Fhyperlog/lists"}