+
+static int cmd_quickstart( char *args[], char *outbuff)
+{
+ char tmp[128];
+ onecommand("yaz_log_file zebrash.log",outbuff);
+ onecommand("yaz_log_prefix ZebraSh", outbuff);
+ sprintf(tmp, "yaz_log_level 0x%x", LOG_DEFAULT_LEVEL | LOG_APP);
+ onecommand(tmp,outbuff);
+ logf(LOG_APP,"quickstart");
+ onecommand("zebra_start",outbuff);
+ onecommand("zebra_open",outbuff);
+ onecommand("select_database Default",outbuff);
+ strcat(outbuff,"ok\n");
+ return 0;
+}
+
+/**************************************
+ * Log file handling
+ */
+
+static int cmd_yaz_log_file( char *args[], char *outbuff)
+{
+ char *fn = defarg(args[1],0);
+ char tmp[255];
+ sprintf(tmp, "sending yaz-log to %s\n",fn);
+ strcat(outbuff, tmp);
+ yaz_log_init_file(fn);
+ return 0; /* ok */
+}
+
+static int cmd_yaz_log_level( char *args[], char *outbuff)
+{
+ int lev = defargint(args[1],LOG_DEFAULT_LEVEL);
+ char tmp[255];
+ sprintf(tmp, "setting yaz-log to level %d (ox%x)\n",lev,lev);
+ strcat(outbuff, tmp);
+ yaz_log_init_level(lev);
+ return 0; /* ok */
+}
+
+static int cmd_yaz_log_prefix( char *args[], char *outbuff)
+{
+ char *pref = defarg(args[1],"ZebraSh");
+ char tmp[255];
+ sprintf(tmp, "setting yaz-log prefix to %s\n",pref);
+ strcat(outbuff, tmp);
+ yaz_log_init_prefix(pref);
+ return 0; /* ok */
+}
+
+static int cmd_logf( char *args[], char *outbuff)
+{
+ int lev = defargint(args[1],0);
+ char tmp[MAX_OUT_BUFF]="";
+ int i=1;
+ if (lev)
+ i=2;
+ else
+ lev=LOG_LOG; /* this is in the default set!*/
+ while (args[i])
+ {
+ strcat(tmp, args[i++]);
+ strcat(tmp, " ");
+ }
+ logf(lev,tmp);
+ return 0; /* ok */
+}