Skip to content

kevlar700/elogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alire

image Awarded

elogs

Embedded logging absent of runtime errors

A logging package primarily developed for embedded use, including systems
without exception propagation. Validated to SPARKs Silver level and so is
proven absent of runtime errors.

The Log_Store memory occupation is configurable via alire configration
Max_Log_Count and Max_Message_Length (Bytes) as well as Log_ID_Length (Bytes).

The size of Log_ID_Length is also configurable by entering the following into
the alire.toml of any crate that depends on elogs.

[configuration.values]
elogs.Log_ID_Length = 16

Although a managed or ragged array or container may provide more efficient
use of memory. Utilising a fixed length String store results in simplifying
the use of SPARK.

An interesting feature of this package is that there are very few Pre and Post
conditions enabling the SPARK proving. Instead the type system intuitively
provides most of the information to gnatprove automatically and gnatprove made
a few pointers for consideration. Aside from annotating package global variable
use. Very few changes were required such as re-ordering a calculation to avoid
any chance of overflow. This has convinced me that the use of SPARK is a far
less daunting prospect than I had expected and a tool that can be used generally
upto silver level with less commitment than I had realised, enabled by Adas
excellent type system.

A note on the new shorter default length of Log_ID

Z85 is designed to maximise character usage whilst being safely used in source
code. You can maximise the entropy density of the log ID text string by
utilising the Z85 alphabet randomly or a Z85 encoder upon random bytes such as
is available from the following URL if it isn't already a crate. Compared to Hex,
Z85 provides 45 bits of entropy vs 28.

https://github.com/jhumphry/Ada_BinToAsc

   Z85_Alphabet : constant BToA.Alphabet_85 :=
     "0123456789" &
     "abcdefghij" &
     "klmnopqrst" &
     "uvwxyzABCD" &
     "EFGHIJKLMN" &
     "OPQRSTUVWX" &
     "YZ.-:+=^!/" &
     "*?&<>()[]{" &
     "}@%$#";

About

Embedded logging absent of runtime errors

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages