1- /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.50 2008/03/27 07:56:00 meskes Exp $ */
1+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.51 2008/05/16 15:20:03 petere Exp $ */
22
33#define POSTGRES_ECPG_INTERNAL
44#include "postgres_fe.h"
@@ -144,14 +144,14 @@ ecpg_finish(struct connection * act)
144144if (actual_connection == act )
145145actual_connection = all_connections ;
146146
147- ecpg_log ("ecpg_finish:Connection %s closed. \n" ,act -> name );
147+ ecpg_log ("ecpg_finish:connection %s closed\n" ,act -> name );
148148
149149for (cache = act -> cache_head ;cache ;ptr = cache ,cache = cache -> next ,ecpg_free (ptr ));
150150ecpg_free (act -> name );
151151ecpg_free (act );
152152}
153153else
154- ecpg_log ("ecpg_finish: called an extra time. \n" );
154+ ecpg_log ("ecpg_finish: called an extra time\n" );
155155}
156156
157157bool
@@ -163,7 +163,7 @@ ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
163163if (!ecpg_init (con ,connection_name ,lineno ))
164164return (false);
165165
166- ecpg_log ("ECPGsetcommit line %d action= %s connection= %s \n" ,lineno ,mode ,con -> name );
166+ ecpg_log ("ECPGsetcommiton line %d: action\"%s\"; connection\"%s\" \n" ,lineno ,mode ,con -> name );
167167
168168if (con -> autocommit == true&& strncmp (mode ,"off" ,strlen ("off" ))== 0 )
169169{
@@ -223,13 +223,13 @@ ECPGnoticeReceiver(void *arg, const PGresult *result)
223223sqlstate = ECPG_SQLSTATE_ECPG_INTERNAL_ERROR ;
224224
225225if (message == NULL )/* Shouldn't happen, but need to be sure */
226- message = "No message received" ;
226+ message = _ ( "No message received" ) ;
227227
228228/* these are not warnings */
229229if (strncmp (sqlstate ,"00" ,2 )== 0 )
230230return ;
231231
232- ecpg_log ("ECPGnoticeReceiver %s\n" ,message );
232+ ecpg_log ("ECPGnoticeReceiver: %s\n" ,message );
233233
234234/* map to SQLCODE for backward compatibility */
235235if (strcmp (sqlstate ,ECPG_SQLSTATE_INVALID_CURSOR_NAME )== 0 )
@@ -377,8 +377,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
377377host = ecpg_strdup (tmp + 1 ,lineno );
378378if (strncmp (dbname ,"unix:" ,5 )!= 0 )
379379{
380- ecpg_log ("ECPGconnect: socketname %s given for TCP connectionin line %d\n" ,host ,lineno );
381- ecpg_raise (lineno ,ECPG_CONNECT ,ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ,realname ?realname :"<DEFAULT>" );
380+ ecpg_log ("ECPGconnect: socketname %s given for TCP connectionon line %d\n" ,host ,lineno );
381+ ecpg_raise (lineno ,ECPG_CONNECT ,ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ,realname ?realname :_ ( "<DEFAULT>" ) );
382382if (host )
383383ecpg_free (host );
384384
@@ -403,8 +403,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
403403{
404404if (strcmp (dbname + offset ,"localhost" )!= 0 && strcmp (dbname + offset ,"127.0.0.1" )!= 0 )
405405{
406- ecpg_log ("ECPGconnect: non-localhost access via socketsin line %d\n" ,lineno );
407- ecpg_raise (lineno ,ECPG_CONNECT ,ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ,realname ?realname :"<DEFAULT>" );
406+ ecpg_log ("ECPGconnect: non-localhost access via socketson line %d\n" ,lineno );
407+ ecpg_raise (lineno ,ECPG_CONNECT ,ECPG_SQLSTATE_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION ,realname ?realname :_ ( "<DEFAULT>" ) );
408408if (host )
409409ecpg_free (host );
410410if (port )
@@ -471,11 +471,11 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
471471actual_connection = all_connections ;
472472
473473ecpg_log ("ECPGconnect: opening database %s on %s port %s %s%s %s%s\n" ,
474- realname ?realname :"<DEFAULT>" ,
475- host ?host :"<DEFAULT>" ,
476- port ? (ecpg_internal_regression_mode ?"<REGRESSION_PORT>" :port ) :"<DEFAULT>" ,
477- options ?"with options " :"" ,options ?options :"" ,
478- user ?"for user " :"" ,user ?user :"" );
474+ realname ?realname :_ ( "<DEFAULT>" ) ,
475+ host ?host :_ ( "<DEFAULT>" ) ,
476+ port ? (ecpg_internal_regression_mode ?_ ( "<REGRESSION_PORT>" ) :port ) :_ ( "<DEFAULT>" ) ,
477+ options ?_ ( "with options " ) :"" ,options ?options :"" ,
478+ user ?_ ( "for user " ) :"" ,user ?user :"" );
479479
480480connect_string = ecpg_alloc (strlen_or_null (host )
481481+ strlen_or_null (port )
@@ -515,7 +515,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
515515if (PQstatus (this -> connection )== CONNECTION_BAD )
516516{
517517const char * errmsg = PQerrorMessage (this -> connection );
518- const char * db = realname ?realname :"<DEFAULT>" ;
518+ const char * db = realname ?realname :_ ( "<DEFAULT>" ) ;
519519
520520ecpg_log ("ECPGconnect: could not open database: %s\n" ,errmsg );
521521