{"repo":"idelsink/b-log","free":true,"listed":false,"github":"https://github.com/idelsink/b-log","clone":"git clone https://github.com/idelsink/b-log.git","description":"Library for custom logging in bash called 'b-log'.","language":"Shell","stars":82,"topics":["bash","logging","library","stdout","syslog","file","logger"],"license":"MIT","category":"cli-tools","readme_excerpt":"bash logger A library for custom logging in bash called ' b-log '. Based on the idea of log.sh. Features This library has the following features: - multiple log outputs (stdout, file, syslog) - multiple log levels (FATAL, ERROR, ...) - custom templates - custom error levels - piping of error messages Examples Some small examples to show the basic usage. For a simple complete example, see the example.sh file. 01 Basic example See this file. Terminal output: 02 Log to file and syslog See this file. Terminal output: 03 Custom template See this file. Terminal output: Usage Include in script Parameters The B LOG function, acts like the script interface. From here all the parameters can be set. Log level Setting the log level can be accomplished in three different ways. First via a simple integer value, second via the available parameters and last via a function. Logging Logging can be done via two ways. First there are the predefined functions: Second the underlying generic functions that is called: The B LOG MESSAGE function, which is used to log messages, can also read from stdin. For example: Logging via stdout Stdout is the standard output used. by default this is enabled. To enable or disable this use the following commands: Logging via a file By default, logging to a file is disabled. To enable this, use the following commands: Logging via the syslog Logging via the linux logger command can be handy in some cases. To enable, use the following: As demonstrated the underlying ","default_branch":null,"files":null,"tree":[],"storefront":"/r/idelsink","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/idelsink/b-log/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}