Add some usage information to the project

This commit is contained in:
R. Tyler Croy 2019-01-05 21:09:51 -08:00
parent 7820791af4
commit 6e210e443d
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
2 changed files with 23 additions and 1 deletions

View File

@ -3,3 +3,21 @@
Logga is a simple, small, and fast logging library for Ada 2012. Unlike
link:https://codelabs.ch/alog/index.html[Alog], which is very powerful and
configurable, Logga aims for the most minimal runtime footprint possible.
== Using
Logga is very simple to use, but has a number of helpful functions which will help write faster logging code in Ada.
[source, ada]
----
with Logga;
procedure Main is
Log : constant Logga.Log_Type := (Level => Logga.Info,
Colors => True);
begin
Log.Info ("Hello World!");
Log.Debug ("This is a {1} message, with a magic number: {2}",
(Log.d ("tokenized"), Log.d (42)));
end Main;
----

View File

@ -43,7 +43,11 @@ package Logga is
function d (L : in Log_Type;
Token : in Integer) return Unbounded_String;
-- T is a small helper function to convert something to an suitable token
-- T is a small helper function to convert something to an suitable token for
-- output.
--
-- NOTE: This function is not optimized and will result in new string allocation
-- regardless of the log level.
function T (Token : in String) return Unbounded_String;
function T (Token : in Integer) return Unbounded_String;