Mantis Bugtracker

Erweiterte Problemanzeige Zu Notizen wechseln ] einfache Anzeige ] Problem-Historie ] Drucken ]
ID Kategorie Auswirkung Reproduzierbar Meldungsdatum Letzte Aktualisierung
0000049 [Bolt] general kleinerer Fehler immer 2009-12-17 13:11 2009-12-17 20:13
Reporter art1 Anzeigestatus öffentlich  
Bearbeitung durch
Priorität normal Lösung erledigt Rechnertyp
Status geschlossen   Betriebssystem
Projektion keine   BS-Version
Aufwand keine Behoben in Version 1.0 Produktversion 1.0-beta
  Zielversion Produkt-Build
Zusammenfassung 0000049: Bug or Feature in Bolt? Error if computed string in "LOG s LEVEL..."
Beschreibung Hello Xavier,

I want to use your bolt-library to have access to
log4ocaml-functionality.

In my code I use as an example this line:

 LOG (Printf.sprintf "walker: processing sdnumber: %s\n" s) LEVEL INFO;

But the compiler means that would be wrong:

 File "main_layout.ml", line 37, characters 14-15:
 Parse error: [expr level ;] expected after "in" (in [expr])
 Preprocessor error

I compiled this with "ocamlopt.opt -pp "camlp4o $(BOLT) -level INFO"

If I replace the line with:

 LOG "walker" LEVEL INFO;

the compiler is happy and the binary will be created (and works as
expected).

If I am wrong, could you explain me this behaviour, please?

Thanks in advance,

Bye Andreas
Schritte zur Reproduktion
Zusätzliche Information
Tags Keine Tags zugeordnet.
Angehängte Dateien

- Problem-Beziehungen

-  Notiz
(0000198)
xclerc (Administrator)
2009-12-17 20:13

This is indeed how version 1.0-beta worked: the argument following the "LOG"
keyword had to be a string literal (and not any expression with type string).

However, I stumbled upon the very same problem you experienced.
As a consequence, the syntax has been extended to allow the following construct:
    LOG <format-string> <arguments> <attributes> LEVEL <lvl>

In your case, this means:
    LOG "walker: processing sdnumber: %s\n" s LEVEL INFO

- Problem-Historie
Änderungsdatum Benutzername Feld Änderung
2009-12-17 13:11 art1 Neues Problem
2009-12-17 20:13 xclerc Problemnotiz hinzugefügt: 0000198
2009-12-17 20:13 xclerc Status neu => geschlossen
2009-12-17 20:13 xclerc Lösung offen => erledigt
2009-12-17 20:13 xclerc Behoben in Version => 1.0


Mantis 1.1.7[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker