{"id":18644236,"url":"https://github.com/lapuske/log_me","last_synced_at":"2025-07-06T05:35:05.232Z","repository":{"id":197379162,"uuid":"698537239","full_name":"lapuske/log_me","owner":"lapuske","description":"Colorful logger package.","archived":false,"fork":false,"pushed_at":"2023-10-26T08:29:07.000Z","size":105,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T11:21:12.894Z","etag":null,"topics":["dart","log","logger","logging"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/log_me","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lapuske.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-09-30T07:55:15.000Z","updated_at":"2024-11-15T01:54:27.000Z","dependencies_parsed_at":"2024-11-07T06:11:02.222Z","dependency_job_id":"220c2902-616f-46e1-8aa5-0c0bf2cb2f1d","html_url":"https://github.com/lapuske/log_me","commit_stats":null,"previous_names":["lapuske/log_me"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapuske%2Flog_me","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapuske%2Flog_me/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapuske%2Flog_me/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapuske%2Flog_me/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lapuske","download_url":"https://codeload.github.com/lapuske/log_me/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239449406,"owners_count":19640530,"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":["dart","log","logger","logging"],"created_at":"2024-11-07T06:10:49.918Z","updated_at":"2025-02-18T09:42:05.566Z","avatar_url":"https://github.com/lapuske.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[`log_me`]\n========\n\n[`log_me`] is a simple logger utility with configurable colors and log levels out of the box, using simple `print` under the hood.\n\n__Note__, that your console must support [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) for colors to be visible.\n\n![Screenshot](https://raw.githubusercontent.com/lapuske/log_me/main/screenshot.png \"Screenshot\")\n\n* [Getting started](#getting-started)\n* [Usage](#usage)\n  * [File output](#file-output)\n* [Configuration](#configuration)\n* [Roadmap](#roadmap)\n\n\n\n\n## Getting started\n\n1. Add the package to your dependencies:\n\n```yaml\ndependencies:\n  log_me: ^0.1.2\n```\n\nor\n\n```yaml\ndependencies:\n  log_me:\n    git: https://github.com/lapuske/log_me.git\n```\n\n2. Import the package and use it:\n\n```dart\nimport 'package:log_me/log_me.dart';\n\nvoid main() {\n  Log.print('Hello, world!');\n}\n```\n\nor\n\n```dart\nimport 'package:log_me/log_me.dart' as me;\n\nvoid main() {\n  me.Log.print('Hello, world!');\n}\n```\n\n\n\n\n## Usage\n\nDetailed example is provided within `/example` directory.\n\n```dart\nimport 'package:log_me/log_me.dart';\n\nvoid main() {\n  // Optional configuration.\n  Log.options = LogOptions(level: LogLevel.all);\n\n  // Prints the provided message at info level.\n  Log.info('Hello, world!');\n\n  // Prints the provided message as the error.\n  Log.error('Error happened, sadly...');\n\n  // Prints the provided message at debug level.\n  //\n  // `toString()` is invoked on every object, so you can pass anything there.\n  Log.debug([0, 1, 2]);\n}\n```\n\n\n### File output\n\nAs of now, outputting to a file is possible by using the `LogOptions.output` argument, for example, like this:\n\n```dart\nLog.options = LogOptions(\n  output: (record, options) {\n    // File to log records to.\n    final File file = File('log.txt');\n\n    // Appends the [file] with [LogRecord.format]ted record.\n    file.writeAsStringSync(\n      // Note, that you may use the different [LogOptions] here in order, for\n      // example, to see different outputs in the console and in the file.\n      //\n      // Just remember, that ANSI escape codes won't render the colors, it's\n      // mostly a console only feature, so be sure to use [LogColors.none].\n      //\n      // Notice, that EVERY record calls this function, so you must check the\n      // [LogLevel]s by yourself, whether you want this record to be written\n      // to a file, or not.\n      '${record.format(options.copyWith(colors: LogColors.none))}\\n',\n      mode: FileMode.append,\n    );\n\n    // Invokes the default output (simply a [print] invoke, if record's level\n    // is higher or equal to the [LogOptions.level] set).\n    LogOptions.defaultOutput(record, options);\n  },\n);\n```\n\n\n\n\n## Configuration\n\n\n### Supported colors\n\n- White\n- Black\n- Red\n- Yellow\n- Blue\n- Magenta\n- Cyan\n\n\n### Log levels\n\n- All\n- Fatal\n- Error\n- Warning\n- Info\n- Debug\n- Trace\n\n\n\n### Logger options\n\n```dart\n/// Indicator whether date of the records should be logged.\n///\n/// Example:\n/// * `2023-09-30`\nfinal bool dateStamp;\n\n/// Indicator whether time of the records should be logged.\n///\n/// Example:\n/// * `06:53:45.000030`\nfinal bool timeStamp;\n\n/// Indicator whether [LogLevel] of the records should be logged.\n///\n/// Example:\n/// * `INFO`\n/// * `SEVERE`\nfinal bool levelStamp;\n\n/// Indicator whether date and/or time should be in UTC.\n///\n/// Only meaningful, if [dateStamp] or [timeStamp] is `true`.\nfinal bool utc;\n\n/// Minimum [LogLevel] to log.\nfinal LogLevel level;\n\n/// [LogColors] of the logs.\nfinal LogColors colors;\n\n/// Callback, called when a new [LogRecord] is retrieved.\n///\n/// If not specified, then logger uses the [defaultOutput].\n///\n/// Note, that you may invoke the [defaultOutput] in this callback:\n///\n/// ```dart\n/// output: (record, options) {\n///   final File file = File('log.txt');\n///\n///   file.writeAsStringSync(\n///     '${record.format(options.copyWith(colors: LogColors.none))}\\n',\n///     mode: FileMode.append,\n///   );\n///\n///   LogOptions.defaultOutput(record, options);\n/// }\n/// ```\nfinal void Function(LogRecord record, LogOptions options) output;\n```\n\n\n\n\n## Roadmap\n\n- [ ] Sentry integration.\n\n\n\n\n[`log_me`]: https://pub.dev/packages/log_me","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapuske%2Flog_me","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flapuske%2Flog_me","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapuske%2Flog_me/lists"}