lua-simplelog  Check-in [64435ecf59]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixing up the README for fossil's brand of MarkDown.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 64435ecf59d4416de5edac8ff60e1a07074c3a7f471e30ae440f64d6cd95b2cd
User & Date: llmII 2019-07-11 14:43:55
Context
2019-07-11 14:44
Still fixing the markdown. check-in: 00273291f9 user: llmII tags: trunk
2019-07-11 14:43
Fixing up the README for fossil's brand of MarkDown. check-in: 64435ecf59 user: llmII tags: trunk
2019-07-11 13:52
Document the workings. check-in: 3fe2180ca0 user: llmII tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to README.md.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## Overview

lua-simplelog is a logging library that aims to be performant, simple,
and capable. It exposes a log mannager which in turn is used to open
up log files in the log directory. The loggers keep up with dates and
roll to a new file when the date changes. It provides for multiple
levels out of the box. Each log can use either the default write
settings, or their own. Write settings allow for telling the logger
which level's are enabled for which output.

## Future
- Perhaps allow dynamically adding levels and/or writers?

## Usage
    local log_config = {
      -- this directory must exist!
      dir = '/tmp/simplelog',
      daemonized = true,
      debug_info = true,











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## Overview

lua-simplelog is a logging library that aims to be performant, simple,
and capable. It exposes a log mannager which in turn is used to open
up log files in the log directory. The loggers keep up with dates and
roll to a new file when the date changes. It provides for multiple
levels out of the box. Each log can use either the default write
settings, or their own. Write settings allow for telling the logger
which level's are enabled for which output.

## Future
* Perhaps allow dynamically adding levels and/or writers?

## Usage
    local log_config = {
      -- this directory must exist!
      dir = '/tmp/simplelog',
      daemonized = true,
      debug_info = true,
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
    log_manager:close_all()

## Documentation

### Levels
These are the available log levels in order of importance with highest
importance being listed last.
- trace
- debug
- info
- warn
- error
- fatal

### Log manager
This is what's returned when you import the module.

Once you initialize a manager with a config like
`local manager = (require 'simplelog')(cfg_table)`
the following functions become avaliable:

Functions:
- open(string name) - opens a log file with the name given and creates
  said file under the directory given in the configuration. Returns
  the log file object.
- close(string name) - closes a previously opened log file by name
- closeall() - closes all log files managed by this manager

**Configuration is explained below:**
Excerpt from example:

      dir = '/tmp/simplelog',
      daemonized = true,
      debug_info = true,







|
|
|
|
|
|









|


|
|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
    log_manager:close_all()

## Documentation

### Levels
These are the available log levels in order of importance with highest
importance being listed last.
* trace
* debug
* info
* warn
* error
* fatal

### Log manager
This is what's returned when you import the module.

Once you initialize a manager with a config like
`local manager = (require 'simplelog')(cfg_table)`
the following functions become avaliable:

Functions:
* open(string name) - opens a log file with the name given and creates
  said file under the directory given in the configuration. Returns
  the log file object.
* close(string name) - closes a previously opened log file by name
* closeall() - closes all log files managed by this manager

**Configuration is explained below:**
Excerpt from example:

      dir = '/tmp/simplelog',
      daemonized = true,
      debug_info = true,
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    }

The table key `dir` is required and is the directory in which log
files will be created. The `logs.default` is also required. The rest
is optional.

Manager configuration:
- dir : The directory to which log files will be written.
- daemonized : Used to determine if it is neccessary to disable
  stdout/stderr logging.
- debug_info: If enabled, the logger will include source line info in
  the output.

Log Configuration:

Each log can be configured to only write log lines above a certain
level. If a log, specified by name in the config, exists, then that
configuration is used for determining when to write information,







|
|

|







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    }

The table key `dir` is required and is the directory in which log
files will be created. The `logs.default` is also required. The rest
is optional.

Manager configuration:
* dir : The directory to which log files will be written.
* daemonized : Used to determine if it is neccessary to disable
  stdout/stderr logging.
* debug_info: If enabled, the logger will include source line info in
  the output.

Log Configuration:

Each log can be configured to only write log lines above a certain
level. If a log, specified by name in the config, exists, then that
configuration is used for determining when to write information,