Skip to content

Commit 397af7f

Browse files
committed
es: Update to new kdb-common log interface
1 parent 1802647 commit 397af7f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/es.q

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
];
3333

3434
if[not esInstance like .es.cfg.requiredUrlPrefix;
35-
.log.error "Unsupported Elasticsearch API URL; must be HTTP or HTTPS [ URL: ",string[esInstance]," ]";
35+
.log.if.error "Unsupported Elasticsearch API URL; must be HTTP or HTTPS [ URL: ",string[esInstance]," ]";
3636
'"InvalidElasticSearchInstanceException";
3737
];
3838

@@ -42,13 +42,13 @@
4242

4343
.es.target:esInstance;
4444

45-
.log.info "Elasticsearch instance set [ URL: ",string[.es.target]," ]";
45+
.log.if.info "Elasticsearch instance set [ URL: ",string[.es.target]," ]";
4646
};
4747

4848
/ @returns (Table) All the indices available in the current Elasticsearch instance
4949
/ @see .es.http.get
5050
.es.getAllIndices:{
51-
.log.info "Querying for all available indices from Elasticsearch";
51+
.log.if.info "Querying for all available indices from Elasticsearch";
5252
:.es.http.get "_cat/indices?v&format=json";
5353
};
5454

@@ -86,7 +86,7 @@
8686
.es.http.get:{[relativeUrl]
8787
url:.es.i.buildUrl relativeUrl;
8888

89-
.log.debug "Elasticsearch HTTP GET [ URL: ",string[url]," ]";
89+
.log.if.debug "Elasticsearch HTTP GET [ URL: ",string[url]," ]";
9090

9191
:.j.k .es.i.http10get url;
9292
};
@@ -121,7 +121,7 @@
121121

122122
url:.es.i.buildUrl .es.i.normaliseIndex[index],`doc,id;
123123

124-
.log.debug "Elasticsearch HTTP POST [ URL: ",string[url]," ]";
124+
.log.if.debug "Elasticsearch HTTP POST [ URL: ",string[url]," ]";
125125

126126
:.j.k .Q.hp[url; .es.cfg.postMimeTypes`default; content];
127127
};
@@ -147,7 +147,7 @@
147147

148148
content:.es.cfg.bulkRowSeparator,(.es.cfg.bulkRowSeparator sv .j.j each contentTable),"\n";
149149

150-
.log.debug "Elasticsearch HTTP Bulk POST [ URL: ",string[url]," ] [ Size: ",string[count content]," bytes ]";
150+
.log.if.debug "Elasticsearch HTTP Bulk POST [ URL: ",string[url]," ] [ Size: ",string[count content]," bytes ]";
151151

152152
:.j.k .es.i.http10post[url; .es.cfg.postMimeTypes`bulk; content];
153153
};
@@ -158,7 +158,7 @@
158158
/ @returns (Symbol) The index unmodified if it has a date component, otherwise the original index with today's date appended to it
159159
.es.i.normaliseIndex:{[index]
160160
if[not index like "*????.??.??*";
161-
.log.info "No date found in index name. Automatically adding today's date [ Index: ",string[index]," ]";
161+
.log.if.info "No date found in index name. Automatically adding today's date [ Index: ",string[index]," ]";
162162
index:`$"-" sv string (index; .time.today[]);
163163
];
164164

@@ -173,7 +173,7 @@
173173
/ @throws InvalidElasticSearchUrlException If the URL specified is of an incorrect type
174174
.es.i.buildUrl:{[relativeUrl]
175175
if[null .es.target;
176-
.log.error "Cannot use Elasticsearch API, no instance specified yet [ Request URL: ",.Q.s1[relativeUrl]," ]";
176+
.log.if.error "Cannot use Elasticsearch API, no instance specified yet [ Request URL: ",.Q.s1[relativeUrl]," ]";
177177
'"NoElasticsearchUrlException";
178178
];
179179

0 commit comments

Comments
 (0)