Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alire-project/simple_logging
Easy to use logging facilities for output to console in Ada programs
https://github.com/alire-project/simple_logging
Last synced: about 2 months ago
JSON representation
Easy to use logging facilities for output to console in Ada programs
- Host: GitHub
- URL: https://github.com/alire-project/simple_logging
- Owner: alire-project
- License: lgpl-3.0
- Created: 2018-03-12T14:31:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-17T03:44:24.000Z (about 1 year ago)
- Last Synced: 2024-04-14T01:49:58.196Z (8 months ago)
- Language: Ada
- Size: 31.3 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ada - simple-logging - Easy to use logging facilities for output to console in Ada programs. (Libraries / Utilities)
README
[![build](https://github.com/alire-project/simple_logging/workflows/Build/badge.svg)](https://github.com/alire-project/simple_logging/actions)
# simple_logging
Easy-to-use logging facilities for output to console in Ada programs.
Preelaborable package.For example:
```ada
with Simple_Logging; use Simple_Logging;procedure Hello_World is
begin
Log ("Hello, world!"); -- Info level (default)
Log ("Bye!", Warning); -- Warning level
Log ("That took 3 mins to write", Debug); -- Won't show with default log level.
Simple_Logging.Level := Debug; -- Lower the threshold for output
Log ("Checking...", Debug); -- Now it will show.
Log ("Something failed", Error); -- Error!
end Hello_World;```
The corresponding output will be:
```
Hello, world!
Warning: Bye!
-->> Checking...
ERROR: Something failed
```Alternatively, you can not use the package and do it like this:
```ada
with Simple_Logging;procedure Hello_World is
package Log renames Simple_Logging;
begin
Log.Info ("Hello, world!");
Log.Warning ("Bye!"); -- Warning level
Log.Debug ("That took 3 mins to write");
Simple_Logging.Level := Debug;
Log.Debug ("Checking...");
Log.Error ("Something failed");
end Hello_World;
```
With the possible benefit that you cannot forget the logging level.