Changeset 4bed82ba2ec9a01ba1c538c5f0f2d7c17e0bd687
- Timestamp:
- 08/01/08 14:28:28
(5 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1217600908 +0000
- git-parent:
[2f4743883d7decd0dabcb5da1a3a772bc4ffab23]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1217600908 +0000
- Message:
update the noit_log new API to allow passing of a context
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rdcd539d |
r4bed82b |
|
| 693 | 693 | "ancestor-or-self::node()/config/*"); |
|---|
| 694 | 694 | ls = noit_log_stream_new(name, type[0] ? type : NULL, |
|---|
| 695 | | path[0] ? path : NULL, config); |
|---|
| | 695 | path[0] ? path : NULL, NULL, config); |
|---|
| 696 | 696 | if(!ls) { |
|---|
| 697 | 697 | fprintf(stderr, "Error configuring log: %s[%s:%s]\n", name, type, path); |
|---|
| rcdd3b47 |
r4bed82b |
|
| 149 | 149 | noit_register_logops("jlog", &jlog_logio_ops); |
|---|
| 150 | 150 | noit_stderr = noit_log_stream_new_on_fd("stderr", 2, NULL); |
|---|
| 151 | | noit_error = noit_log_stream_new("error", NULL, NULL, NULL); |
|---|
| 152 | | noit_debug = noit_log_stream_new("debug", NULL, NULL, NULL); |
|---|
| | 151 | noit_error = noit_log_stream_new("error", NULL, NULL, NULL, NULL); |
|---|
| | 152 | noit_debug = noit_log_stream_new("debug", NULL, NULL, NULL, NULL); |
|---|
| 153 | 153 | } |
|---|
| 154 | 154 | |
|---|
| … | … | |
| 181 | 181 | noit_log_stream_t |
|---|
| 182 | 182 | noit_log_stream_new_on_file(const char *path, noit_hash_table *config) { |
|---|
| 183 | | return noit_log_stream_new(path, "file", path, config); |
|---|
| | 183 | return noit_log_stream_new(path, "file", path, NULL, config); |
|---|
| 184 | 184 | } |
|---|
| 185 | 185 | |
|---|
| 186 | 186 | noit_log_stream_t |
|---|
| 187 | 187 | noit_log_stream_new(const char *name, const char *type, const char *path, |
|---|
| 188 | | noit_hash_table *config) { |
|---|
| | 188 | void *ctx, noit_hash_table *config) { |
|---|
| 189 | 189 | noit_log_stream_t ls, saved; |
|---|
| 190 | 190 | struct _noit_log_stream tmpbuf; |
|---|
| … | … | |
| 221 | 221 | goto freebail; |
|---|
| 222 | 222 | |
|---|
| | 223 | /* This is for things that don't open on paths */ |
|---|
| | 224 | if(ctx) ls->op_ctx = ctx; |
|---|
| 223 | 225 | return ls; |
|---|
| 224 | 226 | |
|---|
| r8d0941e |
r4bed82b |
|
| 43 | 43 | API_EXPORT(noit_log_stream_t) |
|---|
| 44 | 44 | noit_log_stream_new(const char *, const char *, const char *, |
|---|
| 45 | | noit_hash_table *); |
|---|
| | 45 | void *, noit_hash_table *); |
|---|
| 46 | 46 | API_EXPORT(noit_log_stream_t) |
|---|
| 47 | 47 | noit_log_stream_new_on_fd(const char *, int, noit_hash_table *); |
|---|